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  ClientFragment
 
class  ExperimentalFragment
 
class  MainFragment
 
class  PowerFragment
 
class  SecurityFragment
 
class  UiFragment
 

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 getHideStatusBar (Context context)
 
static boolean getHideNavigationBar (Context context)
 
static boolean getFitRoundedCorners (Context context)
 
static boolean getUseBackAsAltf4 (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()

static 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 }
Definition wtypes.h:263

◆ getAcceptAllCertificates()

static boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getAcceptAllCertificates ( 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_accept_certificates), false);
287 }

◆ getAskOnExit()

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

Definition at line 303 of file ApplicationSettingsActivity.java.

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

◆ getAutoScrollTouchPointer()

static boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getAutoScrollTouchPointer ( 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_auto_scroll_touchpointer), false);
315 }

◆ getClientName()

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

Definition at line 317 of file ApplicationSettingsActivity.java.

318 {
319 SharedPreferences preferences = get(context);
320 return preferences.getString(context.getString(R.string.preference_key_client_name), "");
321 }

◆ getDisconnectTimeout()

static 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()

static boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getFitRoundedCorners ( 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_fit_rounded_corners), false);
273 }

◆ getHideNavigationBar()

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

Definition at line 261 of file ApplicationSettingsActivity.java.

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

◆ getHideStatusBar()

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

Definition at line 254 of file ApplicationSettingsActivity.java.

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

◆ getInvertScrolling()

static boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getInvertScrolling ( 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_ui_invert_scrolling), false);
301 }

◆ getKeepScreenOnWhenConnected()

static 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()

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

Definition at line 323 of file ApplicationSettingsActivity.java.

324 {
325 return nightModeFor(
326 get(context).getString(context.getString(R.string.pref_key_theme), "auto"));
327 }

◆ getSwapMouseButtons()

static boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getSwapMouseButtons ( 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_swap_mouse_buttons), false);
294 }

◆ getUseBackAsAltf4()

static boolean com.freerdp.freerdpcore.presentation.ApplicationSettingsActivity.getUseBackAsAltf4 ( 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_use_back_as_altf4), false);
280 }

◆ isExperimentalEnabled()

static 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: