[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [orbot/master] adds toolbar
commit 8585466c9678a241f78e8eb766f5a6ca36b994cd
Author: arrase <arrase@xxxxxxxxx>
Date: Mon Nov 21 21:48:45 2016 +0100
adds toolbar
---
.../android/ui/hs/HiddenServicesActivity.java | 6 +++++
app/src/main/res/layout/layout_hs_list_view.xml | 28 +++++++++++++++-------
.../main/res/layout/layout_hs_list_view_main.xml | 20 ++++++++++++++++
3 files changed, 45 insertions(+), 9 deletions(-)
diff --git a/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java b/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java
index 0fa4f13..b61dd2f 100644
--- a/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java
+++ b/app/src/main/java/org/torproject/android/ui/hs/HiddenServicesActivity.java
@@ -11,6 +11,7 @@ import android.os.Bundle;
import android.os.Handler;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
@@ -25,6 +26,7 @@ import org.torproject.android.ui.hs.providers.HSContentProvider;
public class HiddenServicesActivity extends AppCompatActivity {
private ContentResolver mCR;
private OnionListAdapter mAdapter;
+ private Toolbar toolbar;
private String[] mProjection = new String[]{
HSContentProvider.HiddenService._ID,
@@ -37,6 +39,10 @@ public class HiddenServicesActivity extends AppCompatActivity {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_hs_list_view);
+ toolbar = (Toolbar) findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+
mCR = getContentResolver();
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
diff --git a/app/src/main/res/layout/layout_hs_list_view.xml b/app/src/main/res/layout/layout_hs_list_view.xml
index 551d4e6..fe2bf3f 100644
--- a/app/src/main/res/layout/layout_hs_list_view.xml
+++ b/app/src/main/res/layout/layout_hs_list_view.xml
@@ -1,22 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
- android:id="@+id/main_content"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
- android:layout_height="match_parent">
+ android:layout_height="match_parent"
+ android:fitsSystemWindows="true"
+ tools:context="org.torproject.android.ui.hs.HiddenServicesActivity">
- <ListView
- android:id="@+id/onion_list"
+ <android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
- android:layout_height="match_parent" />
+ android:layout_height="wrap_content">
+
+ <android.support.v7.widget.Toolbar
+ android:id="@+id/toolbar"
+ android:layout_width="match_parent"
+ android:layout_height="?attr/actionBarSize"
+ android:background="?attr/colorPrimary" />
+
+ </android.support.design.widget.AppBarLayout>
+
+ <include layout="@layout/layout_hs_list_view_main" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
- android:layout_margin="16dp"
- android:src="@android:drawable/stat_notify_more"
- app:layout_anchor="@id/onion_list"
- app:layout_anchorGravity="bottom|right|end" />
+ android:layout_margin="@dimen/fab_margin"
+ app:srcCompat="@android:drawable/ic_dialog_email" />
</android.support.design.widget.CoordinatorLayout>
\ No newline at end of file
diff --git a/app/src/main/res/layout/layout_hs_list_view_main.xml b/app/src/main/res/layout/layout_hs_list_view_main.xml
new file mode 100644
index 0000000..bb1c94c
--- /dev/null
+++ b/app/src/main/res/layout/layout_hs_list_view_main.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:app="http://schemas.android.com/apk/res-auto"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:id="@+id/content_main"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:paddingBottom="@dimen/activity_vertical_margin"
+ android:paddingLeft="@dimen/activity_horizontal_margin"
+ android:paddingRight="@dimen/activity_horizontal_margin"
+ android:paddingTop="@dimen/activity_vertical_margin"
+ app:layout_behavior="@string/appbar_scrolling_view_behavior"
+ tools:context="org.torproject.android.ui.hs.HiddenServicesActivity"
+ tools:showIn="@layout/layout_hs_list_view">
+
+ <ListView
+ android:id="@+id/onion_list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" />
+</RelativeLayout>
\ No newline at end of file
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits