Skip to content

Commit

Permalink
Fix/banner view (#711)
Browse files Browse the repository at this point in the history
* Add modules, add fetcher, add service and interactor

* Add fragment and layout

* Add gitingore files

* Di and logic

* Implement layout and logic

* Complete navigation and progress bar

* Fix date format and clean code

* minor changes
  • Loading branch information
antonijzelinskij authored Jan 23, 2023
1 parent 90ba8e3 commit 2429a98
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import androidx.annotation.DrawableRes
import com.google.android.material.card.MaterialCardView
import io.novafoundation.nova.common.R
import io.novafoundation.nova.common.utils.dp
Expand Down Expand Up @@ -49,4 +50,8 @@ class BannerView @JvmOverloads constructor(
bannerContent.addView(child, params)
}
}

fun setImage(@DrawableRes imageRes: Int) {
bannerImage.setImageResource(imageRes)
}
}
16 changes: 4 additions & 12 deletions common/src/main/res/layout/view_banner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/bannerBackground"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="wrap_content">

<ImageView
android:id="@+id/bannerImage"
Expand All @@ -22,24 +22,16 @@
android:scaleType="center"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
app:layout_constraintTop_toTopOf="parent" />

<FrameLayout
android:id="@+id/bannerContent"
android:layout_width="0dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/bannerGuideline"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>

<androidx.constraintlayout.widget.Guideline
android:id="@+id/bannerGuideline"
android:layout_width="0dp"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.74" />
app:layout_constraintTop_toTopOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
1 change: 1 addition & 0 deletions feature-dapp-impl/src/main/res/layout/item_dapp_header.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
android:orientation="vertical"
android:layout_marginTop="20dp"
android:layout_marginBottom="24dp"
android:layout_marginEnd="110dp"
android:layout_marginStart="16dp">

<TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="100dp"
android:layout_marginBottom="24dp">

<TextView
Expand All @@ -36,6 +37,7 @@
android:layout_marginTop="2dp"
android:ellipsize="end"
android:includeFontPadding="false"
android:lines="1"
android:textColor="@color/text_primary"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/userRewardsTitle"
Expand Down

0 comments on commit 2429a98

Please sign in to comment.