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

Public Member Functions

void onCreate (Bundle savedInstanceState)
 
boolean onSupportNavigateUp ()
 

Detailed Description

Definition at line 33 of file ShortcutsActivity.java.

Member Function Documentation

◆ onCreate()

void com.freerdp.freerdpcore.presentation.ShortcutsActivity.onCreate ( Bundle  savedInstanceState)
inline

Definition at line 35 of file ShortcutsActivity.java.

36 {
37 super.onCreate(savedInstanceState);
38
39 if (!Intent.ACTION_CREATE_SHORTCUT.equals(getIntent().getAction()))
40 {
41 finish();
42 return;
43 }
44
45 ActivityShortcutsBinding binding = ActivityShortcutsBinding.inflate(getLayoutInflater());
46 setContentView(binding.getRoot());
47
48 if (getSupportActionBar() != null)
49 getSupportActionBar().setDisplayHomeAsUpEnabled(true);
50
51 ShortcutsViewModel viewModel = new ViewModelProvider(this).get(ShortcutsViewModel.class);
52
53 BookmarkListAdapter adapter = new BookmarkListAdapter();
54 adapter.setActionsEnabled(false);
55 adapter.setCallbacks(new BookmarkListAdapter.Callbacks() {
56 @Override public void onItemClick(String refStr)
57 {
58 if (!ConnectionReference.isBookmarkReference(refStr))
59 return;
60 BookmarkBase bookmark = findBookmark(adapter, refStr);
61 String label = bookmark != null ? bookmark.getLabel() : refStr;
62 setupShortcut(refStr, label);
63 }
64
65 @Override public void onDelete(long id)
66 {
67 }
68 });
69
70 binding.recyclerViewShortcuts.setLayoutManager(new LinearLayoutManager(this));
71 binding.recyclerViewShortcuts.setAdapter(adapter);
72
73 viewModel.getBookmarks().observe(this, adapter::setItems);
74
75 viewModel.loadBookmarks();
76 }

◆ onSupportNavigateUp()

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

Definition at line 78 of file ShortcutsActivity.java.

79 {
80 finish();
81 return true;
82 }

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