mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Remove redundant type casts (#1929)
This commit is contained in:
parent
ef73204cc0
commit
b2e5ad0c26
6 changed files with 12 additions and 12 deletions
|
|
@ -61,7 +61,7 @@ public class WelcomePagerAdapter extends PagerAdapter {
|
||||||
LayoutInflater inflater = LayoutInflater.from(container.getContext());
|
LayoutInflater inflater = LayoutInflater.from(container.getContext());
|
||||||
ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false);
|
ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false);
|
||||||
if( BuildConfig.FLAVOR == "beta"){
|
if( BuildConfig.FLAVOR == "beta"){
|
||||||
TextView textView = (TextView) layout.findViewById(R.id.welcomeYesButton);
|
TextView textView = layout.findViewById(R.id.welcomeYesButton);
|
||||||
if( textView.getVisibility() != View.VISIBLE){
|
if( textView.getVisibility() != View.VISIBLE){
|
||||||
textView.setVisibility(View.VISIBLE);
|
textView.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -338,9 +338,9 @@ public class AchievementsActivity extends NavigationBaseActivity {
|
||||||
AlertDialog.Builder alertadd = new AlertDialog.Builder(AchievementsActivity.this);
|
AlertDialog.Builder alertadd = new AlertDialog.Builder(AchievementsActivity.this);
|
||||||
LayoutInflater factory = LayoutInflater.from(AchievementsActivity.this);
|
LayoutInflater factory = LayoutInflater.from(AchievementsActivity.this);
|
||||||
final View view = factory.inflate(R.layout.image_alert_layout, null);
|
final View view = factory.inflate(R.layout.image_alert_layout, null);
|
||||||
ImageView screenShotImage = (ImageView) view.findViewById(R.id.alert_image);
|
ImageView screenShotImage = view.findViewById(R.id.alert_image);
|
||||||
screenShotImage.setImageBitmap(screenshot);
|
screenShotImage.setImageBitmap(screenshot);
|
||||||
TextView shareMessage = (TextView) view.findViewById(R.id.alert_text);
|
TextView shareMessage = view.findViewById(R.id.alert_text);
|
||||||
shareMessage.setText(R.string.achievements_share_message);
|
shareMessage.setText(R.string.achievements_share_message);
|
||||||
alertadd.setView(view);
|
alertadd.setView(view);
|
||||||
alertadd.setPositiveButton(R.string.about_translate_proceed, (dialog, which) -> shareScreen(screenshot));
|
alertadd.setPositiveButton(R.string.about_translate_proceed, (dialog, which) -> shareScreen(screenshot));
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ class ContributionViewHolder {
|
||||||
final ProgressBar progressView;
|
final ProgressBar progressView;
|
||||||
|
|
||||||
ContributionViewHolder(View parent) {
|
ContributionViewHolder(View parent) {
|
||||||
imageView = (MediaWikiImageView) parent.findViewById(R.id.contributionImage);
|
imageView = parent.findViewById(R.id.contributionImage);
|
||||||
titleView = (TextView)parent.findViewById(R.id.contributionTitle);
|
titleView = parent.findViewById(R.id.contributionTitle);
|
||||||
stateView = (TextView)parent.findViewById(R.id.contributionState);
|
stateView = parent.findViewById(R.id.contributionState);
|
||||||
seqNumView = (TextView)parent.findViewById(R.id.contributionSequenceNumber);
|
seqNumView = parent.findViewById(R.id.contributionSequenceNumber);
|
||||||
progressView = (ProgressBar)parent.findViewById(R.id.contributionProgress);
|
progressView = parent.findViewById(R.id.contributionProgress);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -439,7 +439,7 @@ public class MediaDetailFragment extends CommonsDaggerSupportFragment {
|
||||||
|
|
||||||
private View buildCatLabel(final String catName, ViewGroup categoryContainer) {
|
private View buildCatLabel(final String catName, ViewGroup categoryContainer) {
|
||||||
final View item = LayoutInflater.from(getContext()).inflate(R.layout.detail_category_item, categoryContainer, false);
|
final View item = LayoutInflater.from(getContext()).inflate(R.layout.detail_category_item, categoryContainer, false);
|
||||||
final CompatTextView textView = (CompatTextView) item.findViewById(R.id.mediaDetailCategoryItemText);
|
final CompatTextView textView = item.findViewById(R.id.mediaDetailCategoryItemText);
|
||||||
|
|
||||||
textView.setText(catName);
|
textView.setText(catName);
|
||||||
if (categoriesLoaded && categoriesPresent) {
|
if (categoriesLoaded && categoriesPresent) {
|
||||||
|
|
|
||||||
|
|
@ -186,9 +186,9 @@ public class QuizResultActivity extends AppCompatActivity {
|
||||||
AlertDialog.Builder alertadd = new AlertDialog.Builder(QuizResultActivity.this);
|
AlertDialog.Builder alertadd = new AlertDialog.Builder(QuizResultActivity.this);
|
||||||
LayoutInflater factory = LayoutInflater.from(QuizResultActivity.this);
|
LayoutInflater factory = LayoutInflater.from(QuizResultActivity.this);
|
||||||
final View view = factory.inflate(R.layout.image_alert_layout, null);
|
final View view = factory.inflate(R.layout.image_alert_layout, null);
|
||||||
ImageView screenShotImage = (ImageView) view.findViewById(R.id.alert_image);
|
ImageView screenShotImage = view.findViewById(R.id.alert_image);
|
||||||
screenShotImage.setImageBitmap(screenshot);
|
screenShotImage.setImageBitmap(screenshot);
|
||||||
TextView shareMessage = (TextView) view.findViewById(R.id.alert_text);
|
TextView shareMessage = view.findViewById(R.id.alert_text);
|
||||||
shareMessage.setText(R.string.quiz_result_share_message);
|
shareMessage.setText(R.string.quiz_result_share_message);
|
||||||
alertadd.setView(view);
|
alertadd.setView(view);
|
||||||
alertadd.setPositiveButton(R.string.about_translate_proceed, (dialog, which) -> shareScreen(screenshot));
|
alertadd.setPositiveButton(R.string.about_translate_proceed, (dialog, which) -> shareScreen(screenshot));
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public class RadioGroupHelper {
|
||||||
public RadioGroupHelper(View rootView, int... radiosIDs) {
|
public RadioGroupHelper(View rootView, int... radiosIDs) {
|
||||||
super();
|
super();
|
||||||
for (int radioButtonID : radiosIDs) {
|
for (int radioButtonID : radiosIDs) {
|
||||||
add((RadioButton)rootView.findViewById(radioButtonID));
|
add(rootView.findViewById(radioButtonID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue