mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-24 17:10:33 +00:00
add title to activitys
This commit is contained in:
parent
f23ae091cc
commit
685eebeb56
@ -11,6 +11,7 @@ import android.os.Build;
|
|||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v4.app.NavUtils;
|
import android.support.v4.app.NavUtils;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@ -165,7 +166,15 @@ public class ErrorActivity extends AppCompatActivity {
|
|||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_error);
|
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();
|
ActivityCommunicator ac = ActivityCommunicator.getCommunicator();
|
||||||
errorList = ac.errorList;
|
errorList = ac.errorList;
|
||||||
|
@ -56,7 +56,10 @@ public class SettingsActivity extends PreferenceActivity {
|
|||||||
getDelegate().onCreate(savedInstanceBundle);
|
getDelegate().onCreate(savedInstanceBundle);
|
||||||
super.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()
|
getFragmentManager().beginTransaction()
|
||||||
.replace(android.R.id.content, new SettingsFragment())
|
.replace(android.R.id.content, new SettingsFragment())
|
||||||
|
@ -12,6 +12,7 @@ import android.os.AsyncTask;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.IBinder;
|
import android.os.IBinder;
|
||||||
import android.support.v4.app.NavUtils;
|
import android.support.v4.app.NavUtils;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
import android.support.v7.app.AppCompatActivity;
|
import android.support.v7.app.AppCompatActivity;
|
||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
@ -95,14 +96,14 @@ public class MainActivity extends AppCompatActivity implements AdapterView.OnIte
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_downloader);
|
setContentView(R.layout.activity_downloader);
|
||||||
|
|
||||||
try {
|
|
||||||
//noinspection ConstantConditions
|
|
||||||
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
//noinspection ConstantConditions
|
||||||
} catch(Exception e) {
|
|
||||||
Log.d(TAG, "Could not get SupportActionBar");
|
// its ok if this failes, we will catch that error later, and send it as report
|
||||||
e.printStackTrace();
|
ActionBar actionBar = getSupportActionBar();
|
||||||
}
|
actionBar.setDisplayHomeAsUpEnabled(true);
|
||||||
|
actionBar.setTitle(R.string.downloads_title);
|
||||||
|
actionBar.setDisplayShowTitleEnabled(true);
|
||||||
|
|
||||||
mPrefs = getSharedPreferences("threads", Context.MODE_WORLD_READABLE);
|
mPrefs = getSharedPreferences("threads", Context.MODE_WORLD_READABLE);
|
||||||
|
|
||||||
|
@ -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="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="duration_live">live</string>
|
||||||
<string name="downloads">Downloads</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 -->
|
<!-- error strings -->
|
||||||
<string name="general_error">Error</string>
|
<string name="general_error">Error</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user