Yuvipanda has submitted this change and it was merged. Change subject: Small fixes/cleanup ......................................................................
Small fixes/cleanup - Renamed StylizedButton and StylizedEditText to StyledButton and StyledEditText to be consistent - Colsolodated the constructors for all of the Styled* classes to ease maintenance - Changed instances where instances of WikipediaApp were used to access static class methods - Simplified an instance where a boolean return value was checked before returning it to simple return the result of the function call itself Change-Id: Ie10a13897a147d34cef5ab76d0839aba3b20d1ff --- M wikipedia/res/layout/activity_create_account.xml M wikipedia/res/layout/activity_edit_section.xml M wikipedia/res/layout/activity_langlinks.xml M wikipedia/res/layout/activity_login.xml M wikipedia/res/layout/dialog_preference_languages.xml M wikipedia/res/layout/fragment_page.xml M wikipedia/res/layout/fragment_search.xml M wikipedia/res/layout/group_captcha.xml M wikipedia/src/main/java/org/wikipedia/NavDrawerFragment.java M wikipedia/src/main/java/org/wikipedia/Utils.java M wikipedia/src/main/java/org/wikipedia/networking/ConnectionChangeReceiver.java M wikipedia/src/main/java/org/wikipedia/page/LinkHandler.java M wikipedia/src/main/java/org/wikipedia/page/PageActivity.java M wikipedia/src/main/java/org/wikipedia/page/PageProperties.java M wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java A wikipedia/src/main/java/org/wikipedia/styledviews/StyledButton.java M wikipedia/src/main/java/org/wikipedia/styledviews/StyledCheckBox.java A wikipedia/src/main/java/org/wikipedia/styledviews/StyledEditText.java M wikipedia/src/main/java/org/wikipedia/styledviews/StyledTextView.java D wikipedia/src/main/java/org/wikipedia/styledviews/StylizedButton.java D wikipedia/src/main/java/org/wikipedia/styledviews/StylizedEditText.java 21 files changed, 88 insertions(+), 122 deletions(-) Approvals: Yuvipanda: Verified; Looks good to me, approved diff --git a/wikipedia/res/layout/activity_create_account.xml b/wikipedia/res/layout/activity_create_account.xml index 489a051..7491f22 100644 --- a/wikipedia/res/layout/activity_create_account.xml +++ b/wikipedia/res/layout/activity_create_account.xml @@ -11,7 +11,7 @@ android:orientation="vertical" android:padding="16dp" > - <org.wikipedia.styledviews.StylizedEditText + <org.wikipedia.styledviews.StyledEditText android:id="@+id/create_account_username" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -20,7 +20,7 @@ android:inputType="textNoSuggestions" /> - <org.wikipedia.styledviews.StylizedEditText + <org.wikipedia.styledviews.StyledEditText android:id="@+id/create_account_password" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -29,7 +29,7 @@ android:inputType="textPassword" /> - <org.wikipedia.styledviews.StylizedEditText + <org.wikipedia.styledviews.StyledEditText android:id="@+id/create_account_password_repeat" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -38,7 +38,7 @@ android:inputType="textPassword" /> - <org.wikipedia.styledviews.StylizedEditText + <org.wikipedia.styledviews.StyledEditText android:id="@+id/create_account_email" android:layout_width="match_parent" android:layout_height="wrap_content" diff --git a/wikipedia/res/layout/activity_edit_section.xml b/wikipedia/res/layout/activity_edit_section.xml index c63113a..12a6e34 100644 --- a/wikipedia/res/layout/activity_edit_section.xml +++ b/wikipedia/res/layout/activity_edit_section.xml @@ -24,7 +24,7 @@ style="?android:textAppearanceLarge" /> - <org.wikipedia.styledviews.StylizedButton + <org.wikipedia.styledviews.StyledButton android:id="@+id/edit_section_error_retry" android:text="@string/edit_section_error_retry" android:layout_gravity="center" @@ -35,7 +35,7 @@ android:id="@+id/edit_section_container" android:visibility="gone" android:layout_width="match_parent" android:layout_height="match_parent"> - <org.wikipedia.styledviews.StylizedEditText + <org.wikipedia.styledviews.StyledEditText android:id="@+id/edit_section_text" android:layout_width="match_parent" android:layout_height="match_parent" diff --git a/wikipedia/res/layout/activity_langlinks.xml b/wikipedia/res/layout/activity_langlinks.xml index 0d28d8f..4fbb078 100644 --- a/wikipedia/res/layout/activity_langlinks.xml +++ b/wikipedia/res/layout/activity_langlinks.xml @@ -33,7 +33,7 @@ style="?android:textAppearanceLarge" /> - <org.wikipedia.styledviews.StylizedButton + <org.wikipedia.styledviews.StyledButton android:id="@+id/langlinks_error_retry" android:text="@string/langlinks_error_retry" android:layout_gravity="center" @@ -47,7 +47,7 @@ android:layout_height="match_parent" android:orientation="vertical" android:visibility="gone"> - <org.wikipedia.styledviews.StylizedEditText android:layout_width="match_parent" android:layout_height="wrap_content" + <org.wikipedia.styledviews.StyledEditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/langlinks_filter" android:hint="@string/langlinks_filter_hint" android:singleLine="true" diff --git a/wikipedia/res/layout/activity_login.xml b/wikipedia/res/layout/activity_login.xml index 1722ac8..5f5f0d7 100644 --- a/wikipedia/res/layout/activity_login.xml +++ b/wikipedia/res/layout/activity_login.xml @@ -6,7 +6,7 @@ android:layout_height="match_parent" android:padding="16dp" > - <org.wikipedia.styledviews.StylizedEditText + <org.wikipedia.styledviews.StyledEditText android:id="@+id/login_username_text" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -15,7 +15,7 @@ android:inputType="textNoSuggestions" android:singleLine="true" /> - <org.wikipedia.styledviews.StylizedEditText + <org.wikipedia.styledviews.StyledEditText android:id="@+id/login_password_text" android:layout_width="match_parent" android:layout_height="wrap_content" diff --git a/wikipedia/res/layout/dialog_preference_languages.xml b/wikipedia/res/layout/dialog_preference_languages.xml index 0be74ae..4247709 100644 --- a/wikipedia/res/layout/dialog_preference_languages.xml +++ b/wikipedia/res/layout/dialog_preference_languages.xml @@ -4,7 +4,7 @@ android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent"> - <org.wikipedia.styledviews.StylizedEditText android:layout_width="fill_parent" android:layout_height="wrap_content" + <org.wikipedia.styledviews.StyledEditText android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/preference_languages_filter" android:hint="@string/preference_languages_filter_hint" android:imeOptions="actionDone" diff --git a/wikipedia/res/layout/fragment_page.xml b/wikipedia/res/layout/fragment_page.xml index 51256b2..b4477cf 100644 --- a/wikipedia/res/layout/fragment_page.xml +++ b/wikipedia/res/layout/fragment_page.xml @@ -40,7 +40,7 @@ style="?android:textAppearanceLarge" /> - <org.wikipedia.styledviews.StylizedButton + <org.wikipedia.styledviews.StyledButton android:id="@+id/page_error_retry" android:text="@string/page_error_retry" android:layout_gravity="center" diff --git a/wikipedia/res/layout/fragment_search.xml b/wikipedia/res/layout/fragment_search.xml index 8bd6750..419e6e7 100644 --- a/wikipedia/res/layout/fragment_search.xml +++ b/wikipedia/res/layout/fragment_search.xml @@ -47,7 +47,7 @@ android:layout_gravity="center_vertical" android:layout_weight="1" > - <org.wikipedia.styledviews.StylizedEditText + <org.wikipedia.styledviews.StyledEditText android:id="@+id/search_term_text" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -90,7 +90,7 @@ style="?android:textAppearanceMedium" android:visibility="gone" /> - <org.wikipedia.styledviews.StylizedButton + <org.wikipedia.styledviews.StyledButton android:id="@+id/search_network_error" android:layout_width="match_parent" android:layout_height="48dp" diff --git a/wikipedia/res/layout/group_captcha.xml b/wikipedia/res/layout/group_captcha.xml index 85afdb1..629f1d9 100644 --- a/wikipedia/res/layout/group_captcha.xml +++ b/wikipedia/res/layout/group_captcha.xml @@ -35,7 +35,7 @@ style="?android:textAppearanceSmall" android:gravity="center" /> - <org.wikipedia.styledviews.StylizedEditText android:layout_width="match_parent" android:layout_height="wrap_content" + <org.wikipedia.styledviews.StyledEditText android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margin="16dp" style="?android:textAppearanceMedium" android:layout_gravity="center_horizontal" diff --git a/wikipedia/src/main/java/org/wikipedia/NavDrawerFragment.java b/wikipedia/src/main/java/org/wikipedia/NavDrawerFragment.java index 8598cb0..9e23483 100644 --- a/wikipedia/src/main/java/org/wikipedia/NavDrawerFragment.java +++ b/wikipedia/src/main/java/org/wikipedia/NavDrawerFragment.java @@ -153,7 +153,7 @@ if (ACTION_ITEMS_TEXT[position] == R.string.zero_free_verbiage) { if (WikipediaApp.getWikipediaZeroDisposition()) { - navText.setText(app.getCarrierMessage()); + navText.setText(WikipediaApp.getCarrierMessage()); navText.setTextColor(Color.GRAY); navText.setTextSize(11.0f); } else { diff --git a/wikipedia/src/main/java/org/wikipedia/Utils.java b/wikipedia/src/main/java/org/wikipedia/Utils.java index 8cd307c..88f74ff 100644 --- a/wikipedia/src/main/java/org/wikipedia/Utils.java +++ b/wikipedia/src/main/java/org/wikipedia/Utils.java @@ -208,13 +208,13 @@ boolean responseZeroState = headers.containsKey("X-CS"); if (responseZeroState) { String xcs = headers.get("X-CS").get(0); - if (!xcs.equals(app.getXcs())) { + if (!xcs.equals(WikipediaApp.getXcs())) { identifyZeroCarrier(app, xcs); } - } else if (app.getWikipediaZeroDisposition()) { - app.setXcs(""); - app.setCarrierMessage(""); - app.setWikipediaZeroDisposition(responseZeroState); + } else if (WikipediaApp.getWikipediaZeroDisposition()) { + WikipediaApp.setXcs(""); + WikipediaApp.setCarrierMessage(""); + WikipediaApp.setWikipediaZeroDisposition(responseZeroState); app.getBus().post(new WikipediaZeroStateChangeEvent()); } } @@ -235,9 +235,9 @@ Log.d("Wikipedia", "Wikipedia Zero message: " + message); if (message != null) { - app.setXcs(xcs); - app.setCarrierMessage(message); - app.setWikipediaZeroDisposition(true); + WikipediaApp.setXcs(xcs); + WikipediaApp.setCarrierMessage(message); + WikipediaApp.setWikipediaZeroDisposition(true); Bus bus = app.getBus(); bus.post(new WikipediaZeroStateChangeEvent()); curZeroTask = null; diff --git a/wikipedia/src/main/java/org/wikipedia/networking/ConnectionChangeReceiver.java b/wikipedia/src/main/java/org/wikipedia/networking/ConnectionChangeReceiver.java index 37fa01f..e176ab2 100644 --- a/wikipedia/src/main/java/org/wikipedia/networking/ConnectionChangeReceiver.java +++ b/wikipedia/src/main/java/org/wikipedia/networking/ConnectionChangeReceiver.java @@ -38,7 +38,7 @@ NetworkInfo.State.CONNECTED => isConnected(), but let's call isConnected as documentation suggests. We don't need to check against the zeroconfig API unless the (latest) W0 state is *on* (true). */ - if (app.getWikipediaZeroDisposition() && + if (WikipediaApp.getWikipediaZeroDisposition() && (currentState == NetworkInfo.State.CONNECTED || currentState == NetworkInfo.State.DISCONNECTED) && networkInfo.isConnected() ) { diff --git a/wikipedia/src/main/java/org/wikipedia/page/LinkHandler.java b/wikipedia/src/main/java/org/wikipedia/page/LinkHandler.java index f7ce8f2..2bff0c3 100644 --- a/wikipedia/src/main/java/org/wikipedia/page/LinkHandler.java +++ b/wikipedia/src/main/java/org/wikipedia/page/LinkHandler.java @@ -32,9 +32,9 @@ } private void handleExternalLink(final Uri uri) { - if (WikipediaApp.isWikipediaZeroDevmodeOn() && app.getWikipediaZeroDisposition()) { + if (WikipediaApp.isWikipediaZeroDevmodeOn() && WikipediaApp.getWikipediaZeroDisposition()) { SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(context); - if (sharedPref.getBoolean(app.PREFERENCE_ZERO_INTERSTITIAL, true)) { + if (sharedPref.getBoolean(WikipediaApp.PREFERENCE_ZERO_INTERSTITIAL, true)) { bus.post(new WikipediaZeroInterstitialEvent(uri)); } else { visitExternalLink(uri); diff --git a/wikipedia/src/main/java/org/wikipedia/page/PageActivity.java b/wikipedia/src/main/java/org/wikipedia/page/PageActivity.java index 3aff503..4c65676 100644 --- a/wikipedia/src/main/java/org/wikipedia/page/PageActivity.java +++ b/wikipedia/src/main/java/org/wikipedia/page/PageActivity.java @@ -3,21 +3,16 @@ import android.content.*; import android.net.*; import android.os.*; -import android.support.v4.widget.*; -import android.support.v7.app.*; import com.squareup.otto.*; import org.wikipedia.*; import org.wikipedia.events.*; import org.wikipedia.history.*; import org.wikipedia.interlanguage.*; -import org.wikipedia.networking.*; import org.wikipedia.recurring.*; import org.wikipedia.search.*; import android.app.AlertDialog; -import android.app.DialogFragment; import android.preference.PreferenceManager; -import android.support.v4.app.FragmentActivity; import android.support.v4.widget.DrawerLayout; import android.support.v7.app.ActionBarActivity; import android.widget.Toast; @@ -50,9 +45,6 @@ setContentView(R.layout.activity_main); app = ((WikipediaApp)getApplicationContext()); - - searchAriclesFragment = (SearchArticlesFragment) getSupportFragmentManager().findFragmentById(R.id.search_fragment); - drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); if (savedInstanceState != null) { pausedStateOfZero = savedInstanceState.getBoolean("pausedStateOfZero"); @@ -143,19 +135,19 @@ @Subscribe public void onWikipediaZeroStateChangeEvent(WikipediaZeroStateChangeEvent event) { - boolean latestWikipediaZeroDisposition = app.getWikipediaZeroDisposition(); + boolean latestWikipediaZeroDisposition = WikipediaApp.getWikipediaZeroDisposition(); if (pausedStateOfZero && !latestWikipediaZeroDisposition) { String verbiage = getString(R.string.zero_charged_verbiage); Toast.makeText(app, verbiage, Toast.LENGTH_LONG).show(); showDialogAboutZero(ZERO_OFF_NOTICE_PRESENTED, verbiage); - } else if ((!pausedStateOfZero || !pausedXcsOfZero.equals(app.getXcs())) && latestWikipediaZeroDisposition) { - String verbiage = app.getCarrierMessage(); + } else if ((!pausedStateOfZero || !pausedXcsOfZero.equals(WikipediaApp.getXcs())) && latestWikipediaZeroDisposition) { + String verbiage = WikipediaApp.getCarrierMessage(); Toast.makeText(app, verbiage, Toast.LENGTH_LONG).show(); showDialogAboutZero(ZERO_ON_NOTICE_PRESENTED, verbiage); } pausedStateOfZero = latestWikipediaZeroDisposition; - pausedXcsOfZero = app.getXcs(); + pausedXcsOfZero = WikipediaApp.getXcs(); } private void showDialogAboutZero(String prefsKey, String verbiage) { @@ -228,7 +220,7 @@ @Override protected void onResume() { super.onResume(); - boolean latestWikipediaZeroDispostion = app.getWikipediaZeroDisposition(); + boolean latestWikipediaZeroDispostion = WikipediaApp.getWikipediaZeroDisposition(); if (WikipediaApp.isWikipediaZeroDevmodeOn() && pausedStateOfZero && !latestWikipediaZeroDispostion) { bus.post(new WikipediaZeroStateChangeEvent()); } @@ -237,8 +229,8 @@ @Override public void onPause() { super.onPause(); - pausedStateOfZero = app.getWikipediaZeroDisposition(); - pausedXcsOfZero = app.getXcs(); + pausedStateOfZero = WikipediaApp.getWikipediaZeroDisposition(); + pausedXcsOfZero = WikipediaApp.getXcs(); } @Override diff --git a/wikipedia/src/main/java/org/wikipedia/page/PageProperties.java b/wikipedia/src/main/java/org/wikipedia/page/PageProperties.java index d661812..21f38b0 100644 --- a/wikipedia/src/main/java/org/wikipedia/page/PageProperties.java +++ b/wikipedia/src/main/java/org/wikipedia/page/PageProperties.java @@ -52,9 +52,7 @@ PageProperties that = (PageProperties) o; - if (!lastModified.equals(that.lastModified)) return false; - - return true; + return lastModified.equals(that.lastModified); } public JSONObject toJSON() { diff --git a/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java b/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java index 819af3d..c129354 100644 --- a/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java +++ b/wikipedia/src/main/java/org/wikipedia/search/SearchArticlesFragment.java @@ -390,7 +390,7 @@ @Subscribe public void onWikipediaZeroStateChangeEvent(WikipediaZeroStateChangeEvent event) { - if (app.getWikipediaZeroDisposition()) { + if (WikipediaApp.getWikipediaZeroDisposition()) { setWikipediaZeroChrome(); } else { setNormalChrome(); @@ -421,13 +421,13 @@ @Override public void onPause() { super.onPause(); - pausedStateOfZero = app.getWikipediaZeroDisposition(); + pausedStateOfZero = WikipediaApp.getWikipediaZeroDisposition(); } @Override public void onResume() { super.onResume(); - boolean latestWikipediaZeroDispostion = app.getWikipediaZeroDisposition(); + boolean latestWikipediaZeroDispostion = WikipediaApp.getWikipediaZeroDisposition(); if (pausedStateOfZero != latestWikipediaZeroDispostion) { app.getBus().post(new WikipediaZeroStateChangeEvent()); } else if (latestWikipediaZeroDispostion) { diff --git a/wikipedia/src/main/java/org/wikipedia/styledviews/StyledButton.java b/wikipedia/src/main/java/org/wikipedia/styledviews/StyledButton.java new file mode 100644 index 0000000..d960d7e --- /dev/null +++ b/wikipedia/src/main/java/org/wikipedia/styledviews/StyledButton.java @@ -0,0 +1,23 @@ +package org.wikipedia.styledviews; + +import android.content.*; +import android.util.*; +import android.widget.*; +import org.wikipedia.*; + +public class StyledButton extends Button { + public StyledButton(Context context) { + this(context, null); + } + + public StyledButton(Context context, AttributeSet attrs) { + super(context, attrs, android.R.attr.buttonStyle); + } + + public StyledButton(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + if (!isInEditMode()) { + setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); + } + } +} diff --git a/wikipedia/src/main/java/org/wikipedia/styledviews/StyledCheckBox.java b/wikipedia/src/main/java/org/wikipedia/styledviews/StyledCheckBox.java index adb245a..c0a459a 100644 --- a/wikipedia/src/main/java/org/wikipedia/styledviews/StyledCheckBox.java +++ b/wikipedia/src/main/java/org/wikipedia/styledviews/StyledCheckBox.java @@ -7,17 +7,11 @@ public class StyledCheckBox extends CheckBox { public StyledCheckBox(Context context) { - super(context); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } + this(context, null); } public StyledCheckBox(Context context, AttributeSet attrs) { - super(context, attrs); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } + this(context, attrs, android.R.attr.checkboxStyle); } public StyledCheckBox(Context context, AttributeSet attrs, int defStyle) { diff --git a/wikipedia/src/main/java/org/wikipedia/styledviews/StyledEditText.java b/wikipedia/src/main/java/org/wikipedia/styledviews/StyledEditText.java new file mode 100644 index 0000000..b29cb84 --- /dev/null +++ b/wikipedia/src/main/java/org/wikipedia/styledviews/StyledEditText.java @@ -0,0 +1,23 @@ +package org.wikipedia.styledviews; + +import android.content.*; +import android.util.*; +import android.widget.*; +import org.wikipedia.*; + +public class StyledEditText extends EditText { + public StyledEditText(Context context) { + this(context, null); + } + + public StyledEditText(Context context, AttributeSet attrs) { + this(context, attrs, android.R.attr.editTextStyle); + } + + public StyledEditText(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + if (!isInEditMode()) { + setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); + } + } +} diff --git a/wikipedia/src/main/java/org/wikipedia/styledviews/StyledTextView.java b/wikipedia/src/main/java/org/wikipedia/styledviews/StyledTextView.java index 8d110da..a2a65f7 100644 --- a/wikipedia/src/main/java/org/wikipedia/styledviews/StyledTextView.java +++ b/wikipedia/src/main/java/org/wikipedia/styledviews/StyledTextView.java @@ -7,17 +7,11 @@ public class StyledTextView extends TextView { public StyledTextView(Context context) { - super(context); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } + this(context, null); } public StyledTextView(Context context, AttributeSet attrs) { - super(context, attrs); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } + this(context, attrs, android.R.attr.textViewStyle); } public StyledTextView(Context context, AttributeSet attrs, int defStyle) { diff --git a/wikipedia/src/main/java/org/wikipedia/styledviews/StylizedButton.java b/wikipedia/src/main/java/org/wikipedia/styledviews/StylizedButton.java deleted file mode 100644 index fc399ac..0000000 --- a/wikipedia/src/main/java/org/wikipedia/styledviews/StylizedButton.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.wikipedia.styledviews; - -import android.content.*; -import android.util.*; -import android.widget.*; -import org.wikipedia.*; - -public class StylizedButton extends Button { - public StylizedButton(Context context) { - super(context); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } - } - - public StylizedButton(Context context, AttributeSet attrs) { - super(context, attrs); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } - } - - public StylizedButton(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } - } -} diff --git a/wikipedia/src/main/java/org/wikipedia/styledviews/StylizedEditText.java b/wikipedia/src/main/java/org/wikipedia/styledviews/StylizedEditText.java deleted file mode 100644 index 7ef933c..0000000 --- a/wikipedia/src/main/java/org/wikipedia/styledviews/StylizedEditText.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.wikipedia.styledviews; - -import android.content.*; -import android.util.*; -import android.widget.*; -import org.wikipedia.*; - -public class StylizedEditText extends EditText { - public StylizedEditText(Context context) { - super(context); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } - } - - public StylizedEditText(Context context, AttributeSet attrs) { - super(context, attrs); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } - } - - public StylizedEditText(Context context, AttributeSet attrs, int defStyle) { - super(context, attrs, defStyle); - if (!isInEditMode()) { - setTypeface(((WikipediaApp)context.getApplicationContext()).getPrimaryType()); - } - } -} -- To view, visit https://gerrit.wikimedia.org/r/115101 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie10a13897a147d34cef5ab76d0839aba3b20d1ff Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Nicole <nic...@hitori.org> Gerrit-Reviewer: Yuvipanda <yuvipa...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits