mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
* done * fixed * minor changes made changed tv, Tv to text_view, TextView, improved comment for toggleDescriptionListener
This commit is contained in:
parent
845a901604
commit
117a7805ad
2 changed files with 26 additions and 6 deletions
|
|
@ -89,6 +89,7 @@ public class ContributionsFragment
|
|||
@BindView(R.id.card_view_nearby) public NearbyNotificationCardView nearbyNotificationCardView;
|
||||
@BindView(R.id.campaigns_view) CampaignView campaignView;
|
||||
@BindView(R.id.limited_connection_enabled_layout) LinearLayout limitedConnectionEnabledLayout;
|
||||
@BindView(R.id.limited_connection_description_text_view) TextView limitedConnectionDescriptionTextView;
|
||||
|
||||
@Inject ContributionsPresenter contributionsPresenter;
|
||||
|
||||
|
|
@ -158,6 +159,7 @@ public class ContributionsFragment
|
|||
&& sessionManager.getCurrentAccount() != null) {
|
||||
setUploadCount();
|
||||
}
|
||||
limitedConnectionEnabledLayout.setOnClickListener(toggleDescriptionListener);
|
||||
setHasOptionsMenu(true);
|
||||
return view;
|
||||
}
|
||||
|
|
@ -617,5 +619,21 @@ public class ContributionsFragment
|
|||
public MediaDetailPagerFragment getMediaDetailPagerFragment() {
|
||||
return mediaDetailPagerFragment;
|
||||
}
|
||||
|
||||
// click listener to toggle description that means uses can press the limited connection
|
||||
// banner and description will hide. Tap again to show description.
|
||||
private View.OnClickListener toggleDescriptionListener = new View.OnClickListener() {
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
View view2 = limitedConnectionDescriptionTextView;
|
||||
if (view2.getVisibility() == View.GONE) {
|
||||
view2.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
view2.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,25 +20,27 @@
|
|||
|
||||
<LinearLayout
|
||||
android:id="@+id/limited_connection_enabled_layout"
|
||||
android:animateLayoutChanges="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/miniscule_margin"
|
||||
android:padding="@dimen/standard_gap"
|
||||
android:orientation="vertical"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:background="@color/wikimedia_green">
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/small_gap"
|
||||
app:srcCompat="@drawable/ic_baseline_cloud_off_72"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="5dp"
|
||||
android:textColor="@android:color/white"
|
||||
android:layout_marginBottom="@dimen/tiny_gap"
|
||||
android:textSize="@dimen/subheading_text_size"
|
||||
android:text="@string/limited_connection_is_on"/>
|
||||
android:text="@string/limited_connection_is_on"
|
||||
app:drawableTint="@color/white"
|
||||
app:drawableStartCompat="@drawable/ic_baseline_cloud_off_24"/>
|
||||
<TextView
|
||||
android:id="@+id/limited_connection_description_text_view"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@android:color/white"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue