mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* Moved Main Activity and Settings Activity to ViewBinding * Moving only SettingsActivity for now * Removed values-yue-hant directory * Removing previously done changes to main.xml
This commit is contained in:
parent
fec6dba341
commit
bd06a74caa
2 changed files with 11 additions and 10 deletions
|
|
@ -3,21 +3,19 @@ package fr.free.nrw.commons.settings;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import fr.free.nrw.commons.databinding.ActivitySettingsBinding;
|
||||||
import butterknife.BindView;
|
|
||||||
import butterknife.ButterKnife;
|
|
||||||
import fr.free.nrw.commons.R;
|
|
||||||
import fr.free.nrw.commons.theme.BaseActivity;
|
import fr.free.nrw.commons.theme.BaseActivity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* allows the user to change the settings
|
* allows the user to change the settings
|
||||||
*/
|
*/
|
||||||
public class SettingsActivity extends BaseActivity {
|
public class SettingsActivity extends BaseActivity {
|
||||||
|
|
||||||
|
private ActivitySettingsBinding binding;
|
||||||
private AppCompatDelegate settingsDelegate;
|
private AppCompatDelegate settingsDelegate;
|
||||||
@BindView(R.id.toolbar)
|
|
||||||
Toolbar toolbar;
|
|
||||||
/**
|
/**
|
||||||
* to be called when the activity starts
|
* to be called when the activity starts
|
||||||
* @param savedInstanceState the previously saved state
|
* @param savedInstanceState the previously saved state
|
||||||
|
|
@ -25,10 +23,11 @@ public class SettingsActivity extends BaseActivity {
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_settings);
|
binding = ActivitySettingsBinding.inflate(getLayoutInflater());
|
||||||
|
final View view = binding.getRoot();
|
||||||
|
setContentView(view);
|
||||||
|
|
||||||
ButterKnife.bind(this);
|
setSupportActionBar(binding.toolbarBinding.toolbar);
|
||||||
setSupportActionBar(toolbar);
|
|
||||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,9 @@
|
||||||
android:id="@+id/toolbarLayout"
|
android:id="@+id/toolbarLayout"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="?attr/actionBarSize">
|
android:layout_height="?attr/actionBarSize">
|
||||||
<include layout="@layout/toolbar" />
|
<include
|
||||||
|
android:id="@+id/toolbarBinding"
|
||||||
|
layout="@layout/toolbar" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue