Added label to settings activity

Label added to settings activity and changed spaces to tabs.
This commit is contained in:
luca0N! 2021-03-09 23:33:03 -03:00
parent f32a0a7a43
commit 23e4b4c19d
Signed by: luca0N
GPG Key ID: 2E7B4655CF16D7D6
2 changed files with 48 additions and 49 deletions

View File

@ -1,33 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.luca0n.joguitos.pluck">
package="com.luca0n.joguitos.pluck">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:name=".PluckApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<application
android:name=".PluckApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.Dark">
<activity android:name=".activities.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.TriviaGameActivity"
android:screenOrientation="fullUser"
android:configChanges="orientation|screenSize"/>
<activity android:name=".activities.TriviaGameResultsActivity"
android:screenOrientation="fullUser"
android:configChanges="orientation|screenSize"/>
<activity android:name=".settings.SettingsActivity"
android:screenOrientation="fullUser"
android:configChanges="orientation|screenSize"/>
</application>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activities.TriviaGameActivity"
android:screenOrientation="fullUser"
android:configChanges="orientation|screenSize"/>
<activity android:name=".activities.TriviaGameResultsActivity"
android:screenOrientation="fullUser"
android:configChanges="orientation|screenSize"/>
<activity android:name=".settings.SettingsActivity"
android:label="@string/ui_settings"
android:screenOrientation="fullUser"
android:configChanges="orientation|screenSize"/>
</application>
</manifest>

View File

@ -31,30 +31,28 @@ import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setTitle(null);
}
ActionBar actionBar = getSupportActionBar();
if (actionBar != null)
actionBar.setDisplayHomeAsUpEnabled(true);
getFragmentManager()
.beginTransaction()
.replace(android.R.id.content, new SettingsFragment())
.commit();
}
getFragmentManager()
.beginTransaction()
.replace(android.R.id.content, new SettingsFragment())
.commit();
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
finish();
return true;
default:
return super.onOptionsItemSelected(item);
}
}
}