mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-27 21:03:54 +01:00
Created models, adapters and view models (#4441)
* created models, adapters and view models * Added Image Fragment * back button linked * Documentation and refractor * spaces * Butterknife annotation * DiffUtil * Added Examples * Extended Custom selector From Base Activity * made view model injectable
This commit is contained in:
parent
3cd87072e8
commit
5cc05ba3a4
28 changed files with 1092 additions and 73 deletions
|
|
@ -15,10 +15,11 @@
|
|||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
<include
|
||||
layout="@layout/fragment_custom_selector"
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar_layout"
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
/>
|
||||
app:layout_constraintTop_toBottomOf="@+id/toolbar_layout"/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
<ImageButton
|
||||
android:id="@+id/back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
|
|
@ -13,6 +13,8 @@
|
|||
android:layout_centerVertical="true"
|
||||
android:background="?attr/selectableItemBackgroundBorderless"
|
||||
android:padding="@dimen/standard_gap"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
app:srcCompat="?attr/custom_selector_back" />
|
||||
|
||||
|
||||
|
|
@ -29,7 +31,7 @@
|
|||
android:text="@string/custom_selector_title"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title" />
|
||||
|
||||
<ImageView
|
||||
<ImageButton
|
||||
android:id="@+id/done"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
|
@ -37,6 +39,7 @@
|
|||
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"/>
|
||||
|
|
|
|||
|
|
@ -69,6 +69,19 @@
|
|||
app:fabSize="mini"
|
||||
app:srcCompat="@drawable/ic_photo_white_24dp" />
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_custom_gallery"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:tint="@color/button_blue"
|
||||
android:visibility="gone"
|
||||
app:backgroundTint="@color/main_background_light"
|
||||
app:useCompatPadding="true"
|
||||
app:elevation="@dimen/tiny_margin"
|
||||
app:fabSize="mini"
|
||||
app:srcCompat="@drawable/commons_logo"
|
||||
android:background="@drawable/commons"/>
|
||||
|
||||
<com.google.android.material.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_plus"
|
||||
android:layout_width="wrap_content"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/selector_rv"
|
||||
android:background="?attr/mainBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:padding="@dimen/dimen_2"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
|
|
@ -11,7 +11,6 @@
|
|||
app:cardCornerRadius="@dimen/dimen_6"
|
||||
app:cardElevation="@dimen/dimen_2"
|
||||
android:id="@+id/view"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_constraintDimensionRatio="H,1:1"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
|
|
@ -24,49 +23,47 @@
|
|||
android:id="@+id/folder_thumbnail"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop"/>
|
||||
android:background="@color/black"
|
||||
android:alpha="0.15"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<View
|
||||
android:id="@+id/album_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:id="@+id/album_overlay"
|
||||
android:alpha="0.05"
|
||||
/>
|
||||
android:alpha="0.05" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/folder_details"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
>
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_name"
|
||||
android:id="@+id/folder_name"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_margin="@dimen/dimen_6"
|
||||
android:padding="@dimen/dimen_6"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||
android:layout_weight="1"
|
||||
android:textSize="16sp"
|
||||
android:ellipsize="end"
|
||||
android:padding="@dimen/dimen_6"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="end"/>
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/album_count"
|
||||
android:id="@+id/folder_count"
|
||||
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintRight_toRightOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:layout_margin="5dp"
|
||||
android:padding="5dp"
|
||||
android:textColor="@color/white"
|
||||
android:textStyle="bold"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
android:textStyle="bold"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintRight_toRightOf="parent" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -75,7 +72,7 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
app:constraint_referenced_ids="folder_details,album_overlay"/>
|
||||
app:constraint_referenced_ids="folder_details,album_overlay" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
|
|||
|
|
@ -3,16 +3,16 @@
|
|||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:padding="@dimen/dimen_2"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
app:layout_constraintDimensionRatio="H,1:1"
|
||||
android:layout_height="0dp"
|
||||
app:cardCornerRadius="@dimen/dimen_6"
|
||||
app:cardElevation="@dimen/dimen_2"
|
||||
android:id="@+id/view"
|
||||
app:cardUseCompatPadding="true"
|
||||
app:layout_constraintDimensionRatio="H,1:1"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
|
|
@ -29,7 +29,7 @@
|
|||
android:id="@+id/selected_overlay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:alpha="0.4"
|
||||
android:alpha="0.25"
|
||||
android:background="@color/divider_grey"
|
||||
/>
|
||||
|
||||
|
|
@ -38,18 +38,19 @@
|
|||
android:layout_width="@dimen/dimen_20"
|
||||
android:layout_height="@dimen/dimen_20"
|
||||
app:layout_constraintDimensionRatio="H,1:1"
|
||||
android:layout_margin="@dimen/dimen_10"
|
||||
android:gravity="center|center_vertical"
|
||||
android:includeFontPadding="false"
|
||||
android:textSize="11sp"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/black"
|
||||
android:layout_margin="@dimen/dimen_6"
|
||||
android:gravity="center|center_vertical"
|
||||
style="@style/TextAppearance.AppCompat.Small"
|
||||
android:text="12"
|
||||
android:background="@drawable/circle_shape"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"/>
|
||||
|
||||
|
||||
<androidx.constraintlayout.widget.Group
|
||||
android:id="@+id/selected_view"
|
||||
android:id="@+id/selected_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
|
|
@ -66,15 +67,15 @@
|
|||
|
||||
<ImageView
|
||||
android:id="@+id/uploaded_overlay_icon"
|
||||
android:layout_width="@dimen/dimen_140"
|
||||
android:layout_height="@dimen/dimen_140"
|
||||
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.Group
|
||||
android:id="@+id/uploaded"
|
||||
android:id="@+id/uploaded_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue