[GSoC] Welcome Dialog (#4546)

* Welcome Dialog

* Condition Fix

* Orientation, back button Fix
This commit is contained in:
Aditya-Srivastav 2021-08-14 06:33:26 +05:30 committed by GitHub
parent 79447cfaf3
commit 25156d0e94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 163 additions and 2 deletions

View file

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_margin="@dimen/dimen_10">
<ScrollView
android:layout_height="match_parent"
android:layout_width="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="@string/welcome_custom_picture_selector_text"
android:textSize="@dimen/normal_text"
android:textStyle="bold"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="@dimen/dimen_10"
android:text="@string/custom_selector_info_text1"
android:textSize="@dimen/description_text_size"
android:textStyle="bold"/>
<LinearLayout
android:layout_marginHorizontal="@dimen/dimen_10"
android:layout_width="match_parent"
android:layout_height="@dimen/dimen_150"
android:layout_gravity="center"
android:orientation="horizontal"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_weight="1"
android:layout_width="0dp"
android:padding="@dimen/dimen_2"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
app:cardCornerRadius="@dimen/dimen_6"
android:layout_height="match_parent"
app:cardElevation="@dimen/dimen_2"
android:id="@+id/view"
app:layout_constraintTop_toTopOf="parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image_thumbnail"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/welcome_image_example"/>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_weight="1"
android:layout_width="0dp"
android:padding="@dimen/dimen_2"
android:layout_height="match_parent">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:cardCornerRadius="@dimen/dimen_6"
app:cardElevation="@dimen/dimen_2"
android:id="@+id/view_uploaded"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/image_thumbnail_uploaded"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/welcome_image_example"/>
<View
android:id="@+id/uploaded_overlay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:alpha="0.15"
android:background="@color/black"
tools:layout_editor_absoluteX="0dp"
tools:layout_editor_absoluteY="203dp" />
<ImageView
android:id="@+id/uploaded_overlay_icon"
android:layout_width="@dimen/dimen_72"
android:layout_height="@dimen/dimen_72"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:srcCompat="@drawable/commons"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_10"
android:gravity="center"
android:text="@string/custom_selector_info_text2"
android:textSize="@dimen/description_text_size"
android:textStyle="bold"/>
<androidx.appcompat.widget.AppCompatButton
android:id="@+id/btn_ok"
android:layout_marginHorizontal="@dimen/dimen_40"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="@string/welcome_custom_selector_ok"
/>
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -643,5 +643,10 @@ Upload your first media by tapping on the add button.</string>
<string name="custom_selector_empty_text">No Images</string>
<string name="done">Done</string>
<string name="back">Back</string>
<string name="welcome_custom_picture_selector_text">Welcome to Custom Picture Selector</string>
<string name="custom_selector_info_text1">This picker shows differently pictures that are already to Commons.</string>
<string name="custom_selector_info_text2">Unlike the picture on the left, the picture on the right has the Commons logo indicating it is already uploaded.</string>
<string name="welcome_custom_selector_ok">Awesome</string>
<string name="custom_selector_already_uploaded_image_text">This image has already been uploaded to Commons.</string>
</resources>