Toolbar instead of ActionBar in RepoDetailsActivity.

This commit is contained in:
Peter Serwylo 2017-02-14 11:16:23 +11:00
parent d8dc1698d6
commit 226554c026
3 changed files with 113 additions and 93 deletions

View File

@ -17,6 +17,7 @@ import android.support.v4.app.NavUtils;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.ActionBarActivity; import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AlertDialog; import android.support.v7.app.AlertDialog;
import android.support.v7.widget.Toolbar;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.format.DateUtils; import android.text.format.DateUtils;
import android.view.Menu; import android.view.Menu;
@ -93,8 +94,12 @@ public class RepoDetailsActivity extends ActionBarActivity {
((FDroidApp) getApplication()).applyTheme(this); ((FDroidApp) getApplication()).applyTheme(this);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.repodetails); setContentView(R.layout.repodetails);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
repoView = findViewById(R.id.repoView); repoView = findViewById(R.id.repoView);
repoId = getIntent().getLongExtra(ARG_REPO_ID, 0); repoId = getIntent().getLongExtra(ARG_REPO_ID, 0);

View File

@ -10,7 +10,7 @@
android:title="@string/menu_manage" android:title="@string/menu_manage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:theme="?attr/toolbar_themne"/> android:theme="?attr/toolbar_theme"/>
<ListView <ListView
android:id="@+id/list" android:id="@+id/list"

View File

@ -1,5 +1,18 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:title="@string/repo_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="?attr/toolbar_theme" />
<ScrollView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
@ -99,4 +112,6 @@
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>
</LinearLayout>