forked from AIDEA775/UNCmorfi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
814ad86
commit 4389e8d
Showing
6 changed files
with
127 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.uncmorfi.ui.menu | ||
|
||
import android.content.Context | ||
import android.util.AttributeSet | ||
import android.view.LayoutInflater | ||
import com.bumptech.glide.Glide | ||
import com.google.android.material.card.MaterialCardView | ||
import com.uncmorfi.R | ||
import kotlinx.android.synthetic.main.view_bimo.view.bimoImageView | ||
import kotlinx.android.synthetic.main.view_bimo.view.bimoTextView | ||
|
||
class BiMoView @JvmOverloads constructor( | ||
context: Context, | ||
attr: AttributeSet? = null, | ||
defStyleAttr: Int = 0 | ||
) : MaterialCardView(context, attr, defStyleAttr) { | ||
|
||
init { | ||
LayoutInflater.from(context).inflate(R.layout.view_bimo, this, true) | ||
} | ||
|
||
fun setImage(url : String){ | ||
Glide | ||
.with(this) | ||
.load(url) | ||
.circleCrop() | ||
.into(bimoImageView) | ||
} | ||
|
||
fun setName(name : String){ | ||
bimoTextView.setText(name) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout | ||
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" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
tools:context=".ui.menu.MenuFragment" | ||
android:id="@+id/swipeRefresh" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent"> | ||
android:layout_height="match_parent" | ||
tools:context=".ui.menu.MenuFragment"> | ||
|
||
<com.uncmorfi.ui.menu.BiMoView | ||
android:id="@+id/bimoCard" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
style="@style/MaterialCard" | ||
app:rippleColor="@null" | ||
app:layout_constraintTop_toTopOf="parent"/> | ||
|
||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout | ||
android:id="@+id/swipeRefresh" | ||
android:layout_width="match_parent" | ||
android:layout_height="0dp" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintTop_toBottomOf="@id/bimoCard"> | ||
|
||
<androidx.recyclerview.widget.RecyclerView | ||
android:id="@+id/menuRecyclerView" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:layout_marginTop="8dp" | ||
android:clipToPadding="false" | ||
android:scrollbars="none" | ||
android:nestedScrollingEnabled="false" | ||
android:paddingTop="8dp" | ||
android:paddingBottom="64dp" | ||
tools:listitem="@layout/item_menu"> | ||
</androidx.recyclerview.widget.RecyclerView> | ||
|
||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> | ||
android:scrollbars="none" | ||
tools:listitem="@layout/item_menu" /> | ||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout> | ||
</androidx.constraintlayout.widget.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?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" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
tools:parentTag="com.google.android.material.card.MaterialCardView"> | ||
|
||
<androidx.constraintlayout.widget.ConstraintLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content"> | ||
|
||
<ImageView | ||
android:id="@+id/bimoImageView" | ||
android:layout_width="36dp" | ||
android:layout_height="36dp" | ||
android:layout_margin="8dp" | ||
android:scaleType="centerCrop" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintStart_toStartOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
|
||
<TextView | ||
android:id="@+id/bimoTextView" | ||
android:layout_width="0dp" | ||
android:layout_height="match_parent" | ||
android:layout_marginHorizontal="8dp" | ||
android:textAppearance="@style/TextAppearance.MaterialComponents.Body2" | ||
app:layout_constraintBottom_toBottomOf="@id/bimoImageView" | ||
app:layout_constraintEnd_toEndOf="parent" | ||
app:layout_constraintStart_toEndOf="@id/bimoImageView" | ||
app:layout_constraintTop_toTopOf="@id/bimoImageView" /> | ||
|
||
</androidx.constraintlayout.widget.ConstraintLayout> | ||
</merge> |