FreeRDP
Loading...
Searching...
No Matches
com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity Class Reference
Inheritance diagram for com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity:
Collaboration diagram for com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity:

Data Structures

class  MainFragment
class  ClientFragment
class  UiFragment
class  PowerFragment
class  SecurityFragment
class  ExperimentalFragment

Public Member Functions

boolean onSupportNavigateUp ()
boolean onPreferenceStartFragment (PreferenceFragmentCompat caller, Preference pref)

Static Public Member Functions

static boolean isExperimentalEnabled (Context context, String feature)
static SharedPreferences get (Context context)
static int getDisconnectTimeout (Context context)
static boolean getKeepScreenOnWhenConnected (Context context)
static boolean getAutoReconnect (Context context)
static boolean getHideStatusBar (Context context)
static boolean getHideNavigationBar (Context context)
static boolean getFitRoundedCorners (Context context)
static boolean getUseBackAsAltf4 (Context context)
static boolean getPhysicalKeyboardDeviceLayout (Context context)
static boolean getAcceptAllCertificates (Context context)
static boolean getSwapMouseButtons (Context context)
static boolean getInvertScrolling (Context context)
static boolean getAskOnExit (Context context)
static boolean getAutoScrollTouchPointer (Context context)
static String getClientName (Context context)
static int getNightMode (Context context)

Protected Member Functions

void onCreate (Bundle savedInstanceState)

Detailed Description

Definition at line 31 of file ApplicationSettingsActivity.java.

Member Function Documentation

◆ get()

SharedPreferences com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.get ( Context context)
inlinestatic

Definition at line 217 of file ApplicationSettingsActivity.java.

218 {
219 Context appContext = context.getApplicationContext();
220 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_client, false);
221 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_power, false);
222 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_security, false);
223 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_ui, false);
224 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_experimental, false);
225 SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(appContext);
226
227 final String key = context.getString(R.string.preference_key_client_name);
228 final String value = preferences.getString(key, "");
229 if (value.isEmpty())
230 {
231 final String android_id = UUID.randomUUID().toString();
232 final String defaultValue = context.getString(R.string.preference_default_client_name);
233 final String name = defaultValue + "-" + android_id;
234 preferences.edit().putString(key, name.substring(0, 31)).apply();
235 }
236
237 return preferences;
238 }

◆ getAcceptAllCertificates()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getAcceptAllCertificates ( Context context)
inlinestatic

Definition at line 296 of file ApplicationSettingsActivity.java.

297 {
298 SharedPreferences preferences = get(context);
299 return preferences.getBoolean(
300 context.getString(R.string.preference_key_accept_certificates), false);
301 }

◆ getAskOnExit()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getAskOnExit ( Context context)
inlinestatic

Definition at line 317 of file ApplicationSettingsActivity.java.

318 {
319 SharedPreferences preferences = get(context);
320 return preferences.getBoolean(context.getString(R.string.preference_key_ui_ask_on_exit),
321 true);
322 }

◆ getAutoReconnect()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getAutoReconnect ( Context context)
inlinestatic

Definition at line 254 of file ApplicationSettingsActivity.java.

255 {
256 SharedPreferences preferences = get(context);
257 return preferences.getBoolean(
258 context.getString(R.string.preference_key_power_auto_reconnect), true);
259 }

◆ getAutoScrollTouchPointer()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getAutoScrollTouchPointer ( Context context)
inlinestatic

Definition at line 324 of file ApplicationSettingsActivity.java.

325 {
326 SharedPreferences preferences = get(context);
327 return preferences.getBoolean(
328 context.getString(R.string.preference_key_ui_auto_scroll_touchpointer), false);
329 }

◆ getClientName()

String com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getClientName ( Context context)
inlinestatic

Definition at line 331 of file ApplicationSettingsActivity.java.

332 {
333 SharedPreferences preferences = get(context);
334 return preferences.getString(context.getString(R.string.preference_key_client_name), "");
335 }

◆ getDisconnectTimeout()

int com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getDisconnectTimeout ( Context context)
inlinestatic

Definition at line 240 of file ApplicationSettingsActivity.java.

241 {
242 SharedPreferences preferences = get(context);
243 return preferences.getInt(
244 context.getString(R.string.preference_key_power_disconnect_timeout), 0);
245 }

◆ getFitRoundedCorners()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getFitRoundedCorners ( Context context)
inlinestatic

Definition at line 275 of file ApplicationSettingsActivity.java.

276 {
277 SharedPreferences preferences = get(context);
278 return preferences.getBoolean(
279 context.getString(R.string.preference_key_ui_fit_rounded_corners), false);
280 }

◆ getHideNavigationBar()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getHideNavigationBar ( Context context)
inlinestatic

Definition at line 268 of file ApplicationSettingsActivity.java.

269 {
270 SharedPreferences preferences = get(context);
271 return preferences.getBoolean(
272 context.getString(R.string.preference_key_ui_hide_navigation_bar), false);
273 }

◆ getHideStatusBar()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getHideStatusBar ( Context context)
inlinestatic

Definition at line 261 of file ApplicationSettingsActivity.java.

262 {
263 SharedPreferences preferences = get(context);
264 return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_status_bar),
265 false);
266 }

◆ getInvertScrolling()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getInvertScrolling ( Context context)
inlinestatic

Definition at line 310 of file ApplicationSettingsActivity.java.

311 {
312 SharedPreferences preferences = get(context);
313 return preferences.getBoolean(
314 context.getString(R.string.preference_key_ui_invert_scrolling), true);
315 }

◆ getKeepScreenOnWhenConnected()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getKeepScreenOnWhenConnected ( Context context)
inlinestatic

Definition at line 247 of file ApplicationSettingsActivity.java.

248 {
249 SharedPreferences preferences = get(context);
250 return preferences.getBoolean(
251 context.getString(R.string.preference_key_power_keep_screen_on_when_connected), false);
252 }

◆ getNightMode()

int com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getNightMode ( Context context)
inlinestatic

Definition at line 337 of file ApplicationSettingsActivity.java.

338 {
339 return nightModeFor(
340 get(context).getString(context.getString(R.string.pref_key_theme), "auto"));
341 }

◆ getPhysicalKeyboardDeviceLayout()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getPhysicalKeyboardDeviceLayout ( Context context)
inlinestatic

Definition at line 289 of file ApplicationSettingsActivity.java.

290 {
291 SharedPreferences preferences = get(context);
292 return preferences.getBoolean(
293 context.getString(R.string.preference_key_ui_physical_keyboard_device_layout), false);
294 }

◆ getSwapMouseButtons()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getSwapMouseButtons ( Context context)
inlinestatic

Definition at line 303 of file ApplicationSettingsActivity.java.

304 {
305 SharedPreferences preferences = get(context);
306 return preferences.getBoolean(
307 context.getString(R.string.preference_key_ui_swap_mouse_buttons), false);
308 }

◆ getUseBackAsAltf4()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getUseBackAsAltf4 ( Context context)
inlinestatic

Definition at line 282 of file ApplicationSettingsActivity.java.

283 {
284 SharedPreferences preferences = get(context);
285 return preferences.getBoolean(
286 context.getString(R.string.preference_key_ui_use_back_as_altf4), false);
287 }

◆ isExperimentalEnabled()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.isExperimentalEnabled ( Context context,
String feature )
inlinestatic

Definition at line 212 of file ApplicationSettingsActivity.java.

213 {
214 return get(context).getBoolean("experimental." + feature, false);
215 }

◆ onCreate()

void com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.onCreate ( Bundle savedInstanceState)
inlineprotected

Definition at line 34 of file ApplicationSettingsActivity.java.

35 {
36 super.onCreate(savedInstanceState);
37 setContentView(R.layout.activity_settings);
38
39 // Ensure app setting defaults are initialised and the client name is set.
40 get(this);
41
42 if (getSupportActionBar() != null)
43 {
44 getSupportActionBar().setDisplayHomeAsUpEnabled(true);
45 }
46
47 if (savedInstanceState == null)
48 {
49 getSupportFragmentManager()
50 .beginTransaction()
51 .replace(R.id.settings_fragment_container, new MainFragment())
52 .commit();
53 }
54 }

◆ onPreferenceStartFragment()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.onPreferenceStartFragment ( PreferenceFragmentCompat caller,
Preference pref )
inline

Definition at line 70 of file ApplicationSettingsActivity.java.

71 {
72 PreferenceFragmentCompat fragment =
73 (PreferenceFragmentCompat)getSupportFragmentManager().getFragmentFactory().instantiate(
74 getClassLoader(), pref.getFragment());
75 fragment.setArguments(pref.getExtras());
76
77 getSupportFragmentManager()
78 .beginTransaction()
79 .replace(R.id.settings_fragment_container, fragment)
80 .addToBackStack(null)
81 .commit();
82 return true;
83 }

◆ onSupportNavigateUp()

boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.onSupportNavigateUp ( )
inline

Definition at line 56 of file ApplicationSettingsActivity.java.

57 {
58 if (getSupportFragmentManager().getBackStackEntryCount() > 0)
59 {
60 getSupportFragmentManager().popBackStack();
61 }
62 else
63 {
64 finish();
65 }
66 return true;
67 }

The documentation for this class was generated from the following file: