1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-22 00:30:02 +01:00

add title to activitys

This commit is contained in:
Christian Schabesberger 2016-05-25 23:51:22 +02:00
parent f23ae091cc
commit 685eebeb56
4 changed files with 26 additions and 10 deletions

View File

@ -11,6 +11,7 @@ import android.os.Build;
import android.preference.PreferenceManager;
import android.support.design.widget.Snackbar;
import android.support.v4.app.NavUtils;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.os.Handler;
@ -165,7 +166,15 @@ public class ErrorActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_error);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
try {
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.error_report_title);
actionBar.setDisplayShowTitleEnabled(true);
} catch (Exception e) {
Log.e(TAG, "Error turing exception handling");
e.printStackTrace();
}
ActivityCommunicator ac = ActivityCommunicator.getCommunicator();
errorList = ac.errorList;

View File

@ -56,7 +56,10 @@ public class SettingsActivity extends PreferenceActivity {
getDelegate().onCreate(savedInstanceBundle);
super.onCreate(savedInstanceBundle);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.settings_title);
actionBar.setDisplayShowTitleEnabled(true);
getFragmentManager().beginTransaction()
.replace(android.R.id.content, new SettingsFragment())

View File

@ -12,6 +12,7 @@ import android.os.AsyncTask;
import android.os.Bundle;
import android.os.IBinder;
import android.support.v4.app.NavUtils;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
@ -95,14 +96,14 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIte
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_downloader);
try {
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} catch(Exception e) {
Log.d(TAG, "Could not get SupportActionBar");
e.printStackTrace();
}
//noinspection ConstantConditions
// its ok if this failes, we will catch that error later, and send it as report
ActionBar actionBar = getSupportActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(R.string.downloads_title);
actionBar.setDisplayShowTitleEnabled(true);
mPrefs = getSharedPreferences("threads", Context.MODE_WORLD_READABLE);

View File

@ -80,6 +80,9 @@
<string name="video_is_age_restricted">Video is Age restricted. Enable age restricted videos in the settings first.</string>
<string name="duration_live">live</string>
<string name="downloads">Downloads</string>
<string name="downloads_title">Downloads</string>
<string name="settings_title">Settings</string>
<string name="error_report_title">Error report</string>
<!-- error strings -->
<string name="general_error">Error</string>