Requested changes done

This commit is contained in:
ayans 2022-06-18 17:15:30 +05:30
parent ab7edc4cd2
commit 9d06f154a7
6 changed files with 66 additions and 64 deletions

View file

@ -103,6 +103,15 @@ class CustomSelectorActivity: BaseActivity(), FolderClickListener, ImageSelectLi
.commit() .commit()
fetchData() fetchData()
setUpToolbar() setUpToolbar()
setUpBottomLayout()
}
/**
* Set up bottom layout
*/
private fun setUpBottomLayout() {
val done : Button = findViewById(R.id.upload)
done.setOnClickListener { onDone() }
} }
/** /**
@ -128,9 +137,6 @@ class CustomSelectorActivity: BaseActivity(), FolderClickListener, ImageSelectLi
private fun setUpToolbar() { private fun setUpToolbar() {
val back : ImageButton = findViewById(R.id.back) val back : ImageButton = findViewById(R.id.back)
back.setOnClickListener { onBackPressed() } back.setOnClickListener { onBackPressed() }
val done : Button = findViewById(R.id.upload)
done.setOnClickListener { onDone() }
} }
/** /**

View file

@ -13,53 +13,12 @@
android:id="@+id/fragment_container" android:id="@+id/fragment_container"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintBottom_toTopOf="@id/bottom_layout" app:layout_constraintBottom_toTopOf="@id/bottom_layout"
app:layout_constraintTop_toBottomOf="@+id/toolbar_layout"/> app:layout_constraintTop_toBottomOf="@+id/toolbar_layout"/>
<androidx.constraintlayout.widget.ConstraintLayout <include
android:id="@+id/bottom_layout" layout="@layout/custom_selector_bottom_layout"
android:layout_width="0dp" android:id="@+id/bottom_sheet"
android:layout_height="wrap_content" />
android:background="@color/white"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<Button
android:id="@+id/not_for_upload"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Mark as not for upload"
android:textColor="@color/white"
android:visibility="visible"
android:layout_margin="5dp"
app:layout_constraintBottom_toBottomOf="@id/bottom_layout"
app:layout_constraintEnd_toStartOf="@+id/guideline3"
app:layout_constraintStart_toStartOf="@id/bottom_layout"
app:layout_constraintTop_toTopOf="@id/bottom_layout" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<Button
android:id="@+id/upload"
android:layout_width="0dp"
android:layout_height="0dp"
android:text="Upload"
android:textColor="@color/white"
android:visibility="visible"
android:layout_margin="5dp"
app:layout_constraintBottom_toBottomOf="@id/bottom_layout"
app:layout_constraintEnd_toEndOf="@id/bottom_layout"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="@id/bottom_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bottom_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<Button
android:id="@+id/not_for_upload"
android:layout_width="@dimen/dimen_0"
android:layout_height="wrap_content"
android:text="@string/mark_as_not_for_upload"
android:textColor="@color/white"
android:visibility="visible"
android:layout_margin="@dimen/dimen_5"
app:layout_constraintBottom_toBottomOf="@id/bottom_layout"
app:layout_constraintEnd_toStartOf="@+id/guideline3"
app:layout_constraintStart_toStartOf="@id/bottom_layout"
app:layout_constraintTop_toTopOf="@id/bottom_layout" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<Button
android:id="@+id/upload"
android:layout_width="@dimen/dimen_0"
android:layout_height="@dimen/dimen_0"
android:text="@string/upload"
android:textColor="@color/white"
android:visibility="visible"
android:layout_margin="@dimen/dimen_5"
app:layout_constraintBottom_toBottomOf="@id/bottom_layout"
app:layout_constraintEnd_toEndOf="@id/bottom_layout"
app:layout_constraintStart_toStartOf="@+id/guideline3"
app:layout_constraintTop_toTopOf="@id/bottom_layout" />
</androidx.constraintlayout.widget.ConstraintLayout>
</merge>

View file

@ -28,8 +28,9 @@
android:textAlignment="center" android:textAlignment="center"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/dimen_20"
app:layout_constraintStart_toEndOf="@id/back" app:layout_constraintStart_toEndOf="@id/back"
app:layout_constraintEnd_toStartOf="@id/done" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
android:singleLine="true" android:singleLine="true"
@ -37,20 +38,5 @@
android:text="@string/custom_selector_title" android:text="@string/custom_selector_title"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" /> style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />
<ImageButton
android:id="@+id/done"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:clickable="true"
android:background="?attr/selectableItemBackgroundBorderless"
android:focusable="true"
android:padding="@dimen/standard_gap"
app:srcCompat="?attr/custom_selector_done"
android:visibility="invisible"
android:contentDescription="@string/done" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</merge> </merge>

View file

@ -59,6 +59,7 @@
<!-- Commonly used dimensions --> <!-- Commonly used dimensions -->
<dimen name="dimen_0">0dp</dimen> <dimen name="dimen_0">0dp</dimen>
<dimen name="dimen_2">2dp</dimen> <dimen name="dimen_2">2dp</dimen>
<dimen name="dimen_5">5dp</dimen>
<dimen name="dimen_6">6dp</dimen> <dimen name="dimen_6">6dp</dimen>
<dimen name="dimen_10">10dp</dimen> <dimen name="dimen_10">10dp</dimen>
<dimen name="dimen_20">20dp</dimen> <dimen name="dimen_20">20dp</dimen>

View file

@ -734,4 +734,5 @@ Upload your first media by tapping on the add button.</string>
<string name="error_feedback">Error while sending feedback</string> <string name="error_feedback">Error while sending feedback</string>
<string name="enter_description">What is your feedback?</string> <string name="enter_description">What is your feedback?</string>
<string name="your_feedback">Your feedback</string> <string name="your_feedback">Your feedback</string>
<string name="mark_as_not_for_upload">Mark as not for upload</string>
</resources> </resources>