[Android Event Viewer] Added a button to access the settings and improved the behaviour of the filter button

This commit is contained in:
Alejandro Gallardo Escobar 2017-11-02 17:59:29 +01:00
parent c1323d39e4
commit d7dd37f562
4 changed files with 57 additions and 3 deletions

View File

@ -159,8 +159,14 @@ public class EventList extends ListActivity {
}
});
ImageButton btnSettings = (ImageButton) findViewById(R.id.settings_icon_button_list);
// Open the settings
btnSettings.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(v.getContext(), Options.class));
}
});
registerReceiver(onBroadcast, new IntentFilter("eventlist.java"));
this.toggleLoadingLayout();

View File

@ -96,10 +96,29 @@ public class Main extends Activity {
Activity.MODE_PRIVATE);
setContentView(R.layout.main);
final ImageButton btnSettings = (ImageButton) findViewById(R.id.settings_icon_button_main);
final ImageButton btnFilter = (ImageButton) findViewById(R.id.filter_icon_button_main);
final Button buttonSetAsFilterWatcher = (Button) findViewById(R.id.button_set_as_filter_watcher);
final ImageButton buttonSearch = (ImageButton) findViewById(R.id.refresh_icon_button_main);
final ImageButton buttonDeleteProfile = (ImageButton) findViewById(R.id.button_delete_profile);
final ImageButton buttonSaveProfile = (ImageButton) findViewById(R.id.button_save_profile);
// Open the settings
btnSettings.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
startActivity(new Intent(v.getContext(), Options.class));
}
});
// Go to the events list
btnFilter.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Activity a = (Activity) v.getContext();
TabActivity ta = (TabActivity) a.getParent();
ta.getTabHost().setCurrentTab(1);
}
});
// Check if the user preferences it is set.
if (object.user.length() == 0 || object.password.length() == 0
|| object.url.length() == 0) {

View File

@ -63,8 +63,22 @@
android:layout_weight="0"
android:padding="0dp"
android:src="@drawable/filter_icon_button"
android:background="@null" />
<LinearLayout
android:layout_width="2px"
android:layout_height="fill_parent"
android:background="#6D9624" />
<ImageButton
android:id="@+id/settings_icon_button_list"
android:layout_width="58dp"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@null"
/>
android:tint="@android:color/white"
android:src="@android:drawable/ic_menu_preferences" />
</LinearLayout>
<LinearLayout

View File

@ -64,6 +64,21 @@
android:background="@null"
android:padding="0dp"
android:src="@drawable/icon_filter_pressed" />
<LinearLayout
android:layout_width="2px"
android:layout_height="fill_parent"
android:background="#6D9624" />
<ImageButton
android:id="@+id/settings_icon_button_main"
android:layout_width="58dp"
android:layout_height="match_parent"
android:layout_weight="0"
android:background="@null"
android:tint="@android:color/white"
android:src="@android:drawable/ic_menu_preferences" />
</LinearLayout>
<LinearLayout