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"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <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 <application
android:name=".PluckApplication" android:name=".PluckApplication"
android:allowBackup="true" android:allowBackup="true"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme.Dark">
<activity android:name=".activities.MainActivity"> <activity android:name=".activities.MainActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".activities.TriviaGameActivity" <activity android:name=".activities.TriviaGameActivity"
android:screenOrientation="fullUser" android:screenOrientation="fullUser"
android:configChanges="orientation|screenSize"/> android:configChanges="orientation|screenSize"/>
<activity android:name=".activities.TriviaGameResultsActivity" <activity android:name=".activities.TriviaGameResultsActivity"
android:screenOrientation="fullUser" android:screenOrientation="fullUser"
android:configChanges="orientation|screenSize"/> android:configChanges="orientation|screenSize"/>
<activity android:name=".settings.SettingsActivity" <activity android:name=".settings.SettingsActivity"
android:screenOrientation="fullUser" android:label="@string/ui_settings"
android:configChanges="orientation|screenSize"/> android:screenOrientation="fullUser"
</application> android:configChanges="orientation|screenSize"/>
</application>
</manifest> </manifest>

View File

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