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

Public Member Functions

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

Static Public Member Functions

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 203 of file ApplicationSettingsActivity.java.

204 {
205 Context appContext = context.getApplicationContext();
206 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_client, false);
207 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_power, false);
208 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_security, false);
209 PreferenceManager.setDefaultValues(appContext, R.xml.settings_app_ui, false);
210 SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(appContext);
211
212 final String key = context.getString(R.string.preference_key_client_name);
213 final String value = preferences.getString(key, "");
214 if (value.isEmpty())
215 {
216 final String android_id = UUID.randomUUID().toString();
217 final String defaultValue = context.getString(R.string.preference_default_client_name);
218 final String name = defaultValue + "-" + android_id;
219 preferences.edit().putString(key, name.substring(0, 31)).apply();
220 }
221
222 return preferences;
223 }
Definition wtypes.h:254

◆ getAcceptAllCertificates()

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

Definition at line 267 of file ApplicationSettingsActivity.java.

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

◆ getAskOnExit()

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

Definition at line 288 of file ApplicationSettingsActivity.java.

289 {
290 SharedPreferences preferences = get(context);
291 return preferences.getBoolean(context.getString(R.string.preference_key_ui_ask_on_exit),
292 true);
293 }

◆ getAutoScrollTouchPointer()

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

Definition at line 295 of file ApplicationSettingsActivity.java.

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

◆ getClientName()

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

Definition at line 302 of file ApplicationSettingsActivity.java.

303 {
304 SharedPreferences preferences = get(context);
305 return preferences.getString(context.getString(R.string.preference_key_client_name), "");
306 }

◆ getDisconnectTimeout()

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

Definition at line 225 of file ApplicationSettingsActivity.java.

226 {
227 SharedPreferences preferences = get(context);
228 return preferences.getInt(
229 context.getString(R.string.preference_key_power_disconnect_timeout), 0);
230 }

◆ getFitRoundedCorners()

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

Definition at line 253 of file ApplicationSettingsActivity.java.

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

◆ getHideNavigationBar()

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

Definition at line 246 of file ApplicationSettingsActivity.java.

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

◆ getHideStatusBar()

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

Definition at line 239 of file ApplicationSettingsActivity.java.

240 {
241 SharedPreferences preferences = get(context);
242 return preferences.getBoolean(context.getString(R.string.preference_key_ui_hide_status_bar),
243 false);
244 }

◆ getInvertScrolling()

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

Definition at line 281 of file ApplicationSettingsActivity.java.

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

◆ getKeepScreenOnWhenConnected()

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

Definition at line 232 of file ApplicationSettingsActivity.java.

233 {
234 SharedPreferences preferences = get(context);
235 return preferences.getBoolean(
236 context.getString(R.string.preference_key_power_keep_screen_on_when_connected), false);
237 }

◆ getNightMode()

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

Definition at line 308 of file ApplicationSettingsActivity.java.

309 {
310 return nightModeFor(
311 get(context).getString(context.getString(R.string.pref_key_theme), "auto"));
312 }

◆ getSwapMouseButtons()

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

Definition at line 274 of file ApplicationSettingsActivity.java.

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

◆ getUseBackAsAltf4()

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

Definition at line 260 of file ApplicationSettingsActivity.java.

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

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