*.iml
.idea
#.idea/workspace.xml - remove # and delete .idea if it better suit your needs.
-.gradle
-build/
+/.gradle
+/.idea/
+/local.properties
+build
+*.iml
#NDK
obj/
-jniLibs/
+
+
apply plugin: 'com.android.application'
android {
- compileSdkVersion = rootProject.ext.compileSdk
- buildToolsVersion = rootProject.ext.buildToolsVersion
+ compileSdkVersion 25
+ buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.freerdp.afreerdp"
- minSdkVersion rootProject.ext.minSdk
- targetSdkVersion rootProject.ext.targetSdk
+ minSdkVersion 20
+ targetSdkVersion 25
vectorDrawables.useSupportLibrary = true
- versionCode = rootProject.ext.versionCode
- versionName = rootProject.ext.versionName
+ versionCode 1
+ versionName "1"
}
- signingConfigs {
- release {
- storeFile file(RELEASE_STORE_FILE)
- storePassword RELEASE_STORE_PASSWORD
- keyAlias RELEASE_KEY_ALIAS
- keyPassword RELEASE_KEY_PASSWORD
- storeType "jks"
- }
- }
buildTypes {
release {
minifyEnabled false
- signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
debug {
<application
android:name="com.freerdp.afreerdp.application.GlobalApp"
android:icon="@drawable/icon_launcher_freerdp"
- android:label="aFreeRDP">
+ android:label="aFreeRDP"
+ android:resizeableActivity="true">
+
+
<!-- Main activity -->
<activity
android:name="com.freerdp.freerdpcore.presentation.HomeActivity"
android:alwaysRetainTaskState="true"
android:label="@string/app_title"
- android:theme="@style/Theme.Main">
+ android:theme="@style/Theme.Main"
+ android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|density|screenLayout">
+
<intent-filter android:label="@string/app_title">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
android:name="com.freerdp.freerdpcore.services.FreeRDPSuggestionProvider"
android:authorities="com.freerdp.afreerdp.services.freerdpsuggestionprovider"></provider>
+ <meta-data android:name="com.samsung.android.keepalive.density" android:value="true"/>
+
</application>
</manifest>
def getVersionName = { ->
def stdout = new ByteArrayOutputStream()
- exec {
- commandLine 'git', 'describe', '--tags'
- standardOutput = stdout
- }
+
return stdout.toString().trim()
}
-ext {
- versionCode = properties.get('VERSION', "10").toInteger()
- minSdk = properties.get('MIN_SDK', "14").toInteger()
- targetSdk = properties.get('TARGET_SDK', "25").toInteger()
- compileSdk = properties.get('COMPILE_SDK', "25").toInteger()
- buildToolsVersion = properties.get('BUILD_TOOLS', "25.0.2")
- versionName = properties.get('VERSION_NAME', getVersionName())
- println '----------------- Project configuration -------------------'
- println 'VERSION: ' + versionCode
- println 'MIN_SDK: ' + minSdk
- println 'TARGET_SDK: ' + targetSdk
- println 'COMPILE_SDK: ' + compileSdk
- println 'BUILD_TOOLS: ' + buildToolsVersion
- println 'VERSION_NAME: ' + versionName
- println 'RELEASE_STORE_FILE: '+ RELEASE_STORE_FILE
- println 'RELEASE_KEY_ALIAS: '+ RELEASE_KEY_ALIAS
- println '-----------------------------------------------------------'
-}
buildscript {
repositories {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.3.0'
+ classpath 'com.android.tools.build:gradle:2.3.1'
}
}
apply plugin: 'com.android.library'
android {
- compileSdkVersion = rootProject.ext.compileSdk
- buildToolsVersion = rootProject.ext.buildToolsVersion
+ compileSdkVersion 25
+ buildToolsVersion "25.0.2"
defaultConfig {
- minSdkVersion rootProject.ext.minSdk
- targetSdkVersion rootProject.ext.targetSdk
+ minSdkVersion 20
+ targetSdkVersion 25
vectorDrawables.useSupportLibrary = true
- versionCode = rootProject.ext.versionCode
- versionName = rootProject.ext.versionName
+ versionCode 1
+ versionName "1"
}
buildTypes {
android:smallScreens="true"
android:xlargeScreens="true" />
- <application android:theme="@style/Theme.Main">
-
+ <application android:theme="@style/Theme.Main" android:resizeableActivity="true" >
+ <meta-data android:name="com.samsung.android.keepalive.density" android:value="true"/>
<!-- Activity to create shortcuts -->
<activity
android:name=".presentation.ShortcutsActivity"
android:windowSoftInputMode="stateHidden" />
<activity
android:name=".presentation.SessionActivity"
- android:configChanges="orientation|keyboardHidden|screenSize|keyboard"
android:theme="@style/Theme.Main"
+ android:configChanges="orientation|keyboardHidden|screenSize|smallestScreenSize|density|screenLayout"
android:windowSoftInputMode="adjustResize">
+ <!--android:configChanges="orientation|keyboardHidden|screenSize|keyboard"-->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
static public void freeSession(long instance) {
if (GlobalApp.sessionMap.containsKey(instance)) {
GlobalApp.sessionMap.remove(instance);
- LibFreeRDP.freeInstance(instance);
+ //LibFreeRDP.freeInstance(instance);
}
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
- final String clientNameKey = getString(R.string.preference_key_client_name);
-
- get(getActivity());
- if (key.equals(clientNameKey)) {
- final String clientNameValue = sharedPreferences.getString(clientNameKey, "");
- EditTextPreference pref = (EditTextPreference) findPreference(clientNameKey);
- pref.setText(clientNameValue);
+ if (isAdded()) {
+ final String clientNameKey = getString(R.string.preference_key_client_name);
+
+ get(getActivity());
+ if (key.equals(clientNameKey)) {
+ final String clientNameValue = sharedPreferences.getString(clientNameKey, "");
+ EditTextPreference pref = (EditTextPreference) findPreference(clientNameKey);
+ pref.setText(clientNameValue);
+ }
}
}
}
return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_status_bar), false);
}
+ public static boolean getHideActionBar(Context context) {
+ SharedPreferences preferences = get(context);
+ return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_action_bar), false);
+ }
+
public static boolean getAcceptAllCertificates(Context context) {
SharedPreferences preferences = get(context);
return preferences.getBoolean(context.getString(R.string.preference_key_accept_certificates), false);
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
private PlaceholderBookmark addBookmarkPlaceholder;
private String sectionLabelBookmarks;
+ View mDecor;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.home);
+ mDecor = getWindow().getDecorView();
+ mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
+
long heapSize = Runtime.getRuntime().maxMemory();
Log.i(TAG, "Max HeapSize: " + heapSize);
Log.i(TAG, "App data folder: " + getFilesDir().toString());
});
}
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ // ignore orientation/keyboard change
+ super.onConfigurationChanged(newConfig);
+ mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
+ }
+
@Override
public boolean onSearchRequested() {
superBarEditText.requestFocus();
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
+import android.content.SharedPreferences;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
+import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.view.ViewConfiguration;
private int discardedMoveEvents = 0;
private ClipboardManagerProxy mClipboardManager;
private boolean callbackDialogResult;
+ View mDecor;
private void createDialogs() {
// build verify certificate dialog
}
this.setContentView(R.layout.session);
- if (hasHardwareMenuButton()) {
+ if (hasHardwareMenuButton() || ApplicationSettingsActivity.getHideActionBar(this)) {
this.getSupportActionBar().hide();
} else
this.getSupportActionBar().show();
mClipboardManager = ClipboardManagerProxy.getClipboardManager(this);
mClipboardManager.addClipboardChangedListener(this);
+
+ mDecor = getWindow().getDecorView();
+ mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
@Override
// free session
GlobalApp.freeSession(session.getInstance());
+
session = null;
}
// apply loaded keyboards
keyboardView.setKeyboard(specialkeysKeyboard);
modifiersKeyboardView.setKeyboard(modifiersKeyboard);
+
+ mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
private void processIntent(Intent intent) {
sessionView.onSurfaceChange(session);
scrollView.requestLayout();
keyboardMapper.reset(this);
+ mDecor.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
+
}
private void hideSoftInput() {
scrollView.scrollTo(0, 0);
}
+ @Override
+ public boolean onGenericMotionEvent(MotionEvent e) {
+ super.onGenericMotionEvent(e);
+ switch (e.getAction()) {
+ case MotionEvent.ACTION_SCROLL:
+ final float vScroll = e.getAxisValue(MotionEvent.AXIS_VSCROLL);
+ if (vScroll < 0) {
+ LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, Mouse.getScrollEvent(this, false));
+ }
+ if (vScroll > 0) {
+ LibFreeRDP.sendCursorEvent(session.getInstance(), 0, 0, Mouse.getScrollEvent(this, true));
+ }
+ break;
+ }
+ return true;
+ }
+
// ****************************************************************************
// ClipboardManagerProxy.OnClipboardChangedListener
@Override
import android.graphics.drawable.BitmapDrawable;
import android.util.AttributeSet;
import android.util.Log;
+import android.view.InputDevice;
import android.view.KeyEvent;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import com.freerdp.freerdpcore.application.SessionState;
+import com.freerdp.freerdpcore.services.LibFreeRDP;
import com.freerdp.freerdpcore.utils.DoubleGestureDetector;
import com.freerdp.freerdpcore.utils.GestureDetector;
+import com.freerdp.freerdpcore.utils.Mouse;
import java.util.Stack;
private Matrix invScaleMatrix;
private RectF invalidRegionF;
private GestureDetector gestureDetector;
+ private SessionState currentSession;
//private static final String TAG = "FreeRDP.SessionView";
private DoubleGestureDetector doubleGestureDetector;
scaleMatrix = new Matrix();
invScaleMatrix = new Matrix();
invalidRegionF = new RectF();
+
+ setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
public void setScaleGestureDetector(ScaleGestureDetector scaleGestureDetector) {
setMinimumHeight(height);
requestLayout();
+ currentSession = session;
}
public float getZoom() {
// send single click
MotionEvent mappedEvent = mapTouchEvent(e);
sessionViewListener.onSessionViewBeginTouch();
- sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), true);
- sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), false);
+ switch (e.getButtonState()) {
+ case MotionEvent.BUTTON_PRIMARY:
+ sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), true);
+ sessionViewListener.onSessionViewLeftTouch((int) mappedEvent.getX(), (int) mappedEvent.getY(), false);
+ break;
+ case MotionEvent.BUTTON_SECONDARY:
+ LibFreeRDP.sendCursorEvent(currentSession.getInstance(),
+ (int) mappedEvent.getX(), (int) mappedEvent.getY(), Mouse.getRightButtonEvent(getContext(), true));
+ LibFreeRDP.sendCursorEvent(currentSession.getInstance(),
+ (int) mappedEvent.getX(), (int) mappedEvent.getY(), Mouse.getRightButtonEvent(getContext(), false));
+ break;
+ }
sessionViewListener.onSessionViewEndTouch();
return true;
}
<string name="settings_password_empty">nicht gesetzt</string>
<string name="settings_cat_ui">Benutzeroberfläche</string>
<string name="settings_ui_hide_status_bar">verstecke Statusleiste</string>
+ <string name="settings_ui_hide_action_bar">Aktionsleiste ausblenden</string>
<string name="settings_ui_hide_zoom_controls">verstecke Zoom Tasten</string>
<string name="settings_ui_swap_mouse_buttons">Vertausche Maustasten</string>
<string name="settings_ui_invert_scrolling">Invertiere Bildlauf</string>
<string name="settings_password_empty">no configurado</string>\r
<string name="settings_cat_ui">Interfaze Usuario</string>\r
<string name="settings_ui_hide_status_bar">Ocultar barra de estado</string>\r
+ <string name="settings_ui_hide_action_bar">\"Ocultar barra de acción\"</string>\r
<string name="settings_ui_hide_zoom_controls">Ocultar controles de zoom</string>\r
<string name="settings_ui_swap_mouse_buttons">Intercambiar botones del mouse</string>\r
<string name="settings_ui_invert_scrolling">invertir desplazamiento</string>\r
<string name="settings_password_empty">"Valeur non définie"</string>
<string name="settings_cat_ui">"Interface utilisateur"</string>
<string name="settings_ui_hide_status_bar">"Masquer la barre d'état"</string>
+ <string name="settings_ui_hide_action_bar">\"Masquer la barre d\'action\"</string>
<string name="settings_ui_hide_zoom_controls">"Masquer les contrôles zoom"</string>
<string name="settings_ui_swap_mouse_buttons">"Inverser les boutons de la souris"</string>
<string name="settings_ui_invert_scrolling">"Inverser le défilement de la souris"</string>
<string name="settings_password_empty">Niet ingesteld</string>
<string name="settings_cat_ui">Gebruikersinterface</string>
<string name="settings_ui_hide_status_bar">Verberg statusbalk</string>
+ <string name="settings_ui_hide_action_bar">Verkeersbalk verbergen</string>
<string name="settings_ui_hide_zoom_controls">Verberg Zoom Controls</string>
<string name="settings_ui_swap_mouse_buttons">Wissel muisknoppen</string>
<string name="settings_ui_invert_scrolling">Scrollen omkeren</string>
<string name="settings_password_empty">未设置</string>
<string name="settings_cat_ui">用户界面</string>
<string name="settings_ui_hide_status_bar">隐藏状态栏</string>
+ <string name="settings_ui_hide_action_bar">隱藏操作欄</string>
<string name="settings_ui_hide_zoom_controls">隐藏缩放控件</string>
<string name="settings_ui_swap_mouse_buttons">交换鼠标左右键</string>
<string name="settings_ui_invert_scrolling">翻转滚动</string>
<string name="settings_password_empty">not set</string>
<string name="settings_cat_ui">User Interface</string>
<string name="settings_ui_hide_status_bar">Hide Status Bar</string>
+ <string name="settings_ui_hide_action_bar">Hide Action Bar</string>
<string name="settings_ui_hide_zoom_controls">Hide Zoom Controls</string>
<string name="settings_ui_swap_mouse_buttons">Swap Mouse Buttons</string>
<string name="settings_ui_invert_scrolling">Invert Scrolling</string>
<string name="preference_key_ui_invert_scrolling" translatable="false">ui.invert_scrolling</string>
<string name="preference_key_ui_swap_mouse_buttons" translatable="false">ui.swap_mouse_buttons</string>
<string name="preference_key_ui_hide_zoom_controls" translatable="false">ui.hide_zoom_controls</string>
+ <string name="preference_key_ui_hide_action_bar" translatable="false">ui.hide_action_bar</string>
<string-array name="debug_array" translatable="false">
<item>OFF</item>
<item>FATAL</item>
<?xml version="1.0" encoding="utf-8"?>
-<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+<PreferenceScreen xmlns:tools="http://schemas.android.com/tools"
+ xmlns:android="http://schemas.android.com/apk/res/android">
<CheckBoxPreference
+ android:defaultValue="true"
android:key="@string/preference_key_ui_hide_status_bar"
android:title="@string/settings_ui_hide_status_bar" />
<CheckBoxPreference
+ android:defaultValue="true"
android:key="@string/preference_key_ui_hide_zoom_controls"
android:title="@string/settings_ui_hide_zoom_controls" />
<CheckBoxPreference
android:key="@string/preference_key_ui_swap_mouse_buttons"
android:title="@string/settings_ui_swap_mouse_buttons" />
<CheckBoxPreference
+ android:defaultValue="true"
android:key="@string/preference_key_ui_invert_scrolling"
android:title="@string/settings_ui_invert_scrolling" />
<CheckBoxPreference
android:key="@string/preference_key_ui_auto_scroll_touchpointer"
android:title="@string/settings_ui_auto_scroll_touchpointer" />
<CheckBoxPreference
+ android:defaultValue="true"
android:key="@string/preference_key_ui_ask_on_exit"
android:title="@string/settings_ui_ask_on_exit" />
+ <CheckBoxPreference
+ android:defaultValue="true"
+ android:key="@string/preference_key_ui_hide_action_bar"
+ android:title="@string/settings_ui_hide_action_bar" />
</PreferenceScreen>
\ No newline at end of file