mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Extend from AppCompatActivity instead of Activity
This commit is contained in:
parent
75f2201000
commit
8cc51c4dd9
6 changed files with 15 additions and 49 deletions
|
|
@ -32,11 +32,11 @@
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".auth.LoginActivity"
|
android:name=".auth.LoginActivity"
|
||||||
android:theme="@style/NoTitle" >
|
>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".WelcomeActivity"
|
android:name=".WelcomeActivity"
|
||||||
android:theme="@style/NoTitle" >
|
>
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".upload.ShareActivity"
|
android:name=".upload.ShareActivity"
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,12 @@ import android.text.Html;
|
||||||
import android.text.method.LinkMovementMethod;
|
import android.text.method.LinkMovementMethod;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import fr.free.nrw.commons.theme.BaseActivity;
|
import fr.free.nrw.commons.theme.BaseAppCompatActivity;
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
public class AboutActivity extends BaseActivity {
|
public class AboutActivity extends BaseAppCompatActivity {
|
||||||
@BindView(R.id.about_version) TextView versionText;
|
@BindView(R.id.about_version) TextView versionText;
|
||||||
@BindView(R.id.about_license) TextView licenseText;
|
@BindView(R.id.about_license) TextView licenseText;
|
||||||
@BindView(R.id.about_improve) TextView improveText;
|
@BindView(R.id.about_improve) TextView improveText;
|
||||||
|
|
@ -21,6 +21,9 @@ public class AboutActivity extends BaseActivity {
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_about);
|
setContentView(R.layout.activity_about);
|
||||||
|
|
||||||
|
getSupportActionBar().hide();
|
||||||
|
|
||||||
ButterKnife.bind(this);
|
ButterKnife.bind(this);
|
||||||
|
|
||||||
uploadsToText.setText(CommonsApplication.EVENTLOG_WIKI);
|
uploadsToText.setText(CommonsApplication.EVENTLOG_WIKI);
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,9 @@ import android.widget.Button;
|
||||||
|
|
||||||
import com.viewpagerindicator.CirclePageIndicator;
|
import com.viewpagerindicator.CirclePageIndicator;
|
||||||
|
|
||||||
import fr.free.nrw.commons.theme.BaseActivity;
|
import fr.free.nrw.commons.theme.BaseAppCompatActivity;
|
||||||
|
|
||||||
public class WelcomeActivity extends BaseActivity {
|
public class WelcomeActivity extends BaseAppCompatActivity {
|
||||||
static final int PAGE_WIKIPEDIA = 0,
|
static final int PAGE_WIKIPEDIA = 0,
|
||||||
PAGE_DO_UPLOAD = 1,
|
PAGE_DO_UPLOAD = 1,
|
||||||
PAGE_DONT_UPLOAD = 2,
|
PAGE_DONT_UPLOAD = 2,
|
||||||
|
|
@ -33,6 +33,8 @@ public class WelcomeActivity extends BaseActivity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_welcome);
|
setContentView(R.layout.activity_welcome);
|
||||||
|
|
||||||
|
getSupportActionBar().hide();
|
||||||
|
|
||||||
pager = (ViewPager)findViewById(R.id.welcomePager);
|
pager = (ViewPager)findViewById(R.id.welcomePager);
|
||||||
pager.setAdapter(new PagerAdapter() {
|
pager.setAdapter(new PagerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ import android.webkit.WebView;
|
||||||
import android.webkit.WebViewClient;
|
import android.webkit.WebViewClient;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import fr.free.nrw.commons.theme.BaseActivity;
|
import fr.free.nrw.commons.theme.BaseAppCompatActivity;
|
||||||
|
|
||||||
public class SignupActivity extends BaseActivity {
|
public class SignupActivity extends BaseAppCompatActivity {
|
||||||
|
|
||||||
private WebView webView;
|
private WebView webView;
|
||||||
|
|
||||||
|
|
@ -19,6 +19,8 @@ public class SignupActivity extends BaseActivity {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
Log.d("SignupActivity", "Signup Activity started");
|
Log.d("SignupActivity", "Signup Activity started");
|
||||||
|
|
||||||
|
getSupportActionBar().hide();
|
||||||
|
|
||||||
webView = new WebView(this);
|
webView = new WebView(this);
|
||||||
setContentView(webView);
|
setContentView(webView);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
||||||
package fr.free.nrw.commons.theme;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.preference.PreferenceManager;
|
|
||||||
|
|
||||||
import fr.free.nrw.commons.R;
|
|
||||||
|
|
||||||
|
|
||||||
public class BaseActivity extends Activity {
|
|
||||||
boolean currentTheme;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
if (PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true)) {
|
|
||||||
currentTheme = true;
|
|
||||||
setTheme(R.style.DarkAppTheme);
|
|
||||||
}else {
|
|
||||||
currentTheme = false;
|
|
||||||
setTheme(R.style.LightAppTheme); // default
|
|
||||||
}
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onResume() {
|
|
||||||
// Restart activity if theme is changed
|
|
||||||
boolean newTheme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean("theme",true);
|
|
||||||
if(currentTheme!=newTheme){ // is activity theme changed
|
|
||||||
Intent intent = getIntent();
|
|
||||||
finish();
|
|
||||||
startActivity(intent);
|
|
||||||
}
|
|
||||||
super.onResume();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -43,10 +43,6 @@
|
||||||
<item name="colorControlNormal">#ffffff</item>
|
<item name="colorControlNormal">#ffffff</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="NoTitle" parent="DarkAppTheme">
|
|
||||||
<item name="android:windowNoTitle">true</item>
|
|
||||||
</style>
|
|
||||||
|
|
||||||
<style name="ProgressBar" parent="Widget.AppCompat.ProgressBar.Horizontal" />
|
<style name="ProgressBar" parent="Widget.AppCompat.ProgressBar.Horizontal" />
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue