Home Fragment 2 ui
Custom pressable card with two different press type Hindi versioning for homefragment2
@@ -5,20 +5,86 @@ import androidx.fragment.app.Fragment
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.lifecycle.ViewModelProvider
|
||||
import com.woka.R
|
||||
import com.woka.WokaApp
|
||||
import com.woka.databinding.FragmentHome2Binding
|
||||
import com.woka.home.HomeViewModel
|
||||
import com.woka.mvvm.userDataModels.UserDataResponse
|
||||
import com.woka.networking.ApiResult
|
||||
import com.woka.utils.UserType
|
||||
import com.woka.utils.toast
|
||||
|
||||
class Home2Fragment : Fragment() {
|
||||
|
||||
private lateinit var binding: FragmentHome2Binding
|
||||
|
||||
private lateinit var viewModel: HomeViewModel
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
): View {
|
||||
binding = FragmentHome2Binding.inflate(inflater, container, false)
|
||||
|
||||
activity?.let {
|
||||
viewModel = ViewModelProvider(it)[HomeViewModel::class.java]
|
||||
}
|
||||
|
||||
setObservers()
|
||||
|
||||
clickEvents()
|
||||
|
||||
return binding.root
|
||||
}
|
||||
|
||||
private fun clickEvents(){
|
||||
binding.apply {
|
||||
webSeries.setOnClickListener {
|
||||
toast("toast")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setObservers() {
|
||||
WokaApp.userPrefs?.userLiveData?.observe(viewLifecycleOwner) {
|
||||
if (it is ApiResult.Success) {
|
||||
updateUserData(it.data)
|
||||
}
|
||||
}
|
||||
|
||||
viewModel.localeChangeLiveData.observe(viewLifecycleOwner) {
|
||||
binding.apply {
|
||||
helloTxt.text = getString(R.string.hello)
|
||||
welcomeText.text = getString(R.string.welcome_to_wokaland)
|
||||
|
||||
webSeriesTxt.text = getString(R.string.web_series)
|
||||
liveTvTxt.text = getString(R.string.live_tv)
|
||||
shopTxt.text = getString(R.string.shop)
|
||||
karaokeTxt.text = getString(R.string.karaoke)
|
||||
audioBooksTxt.text = getString(R.string.audio_books)
|
||||
gamesTxt.text = getString(R.string.games)
|
||||
wokaFmTxt.text = getString(R.string.woka_fm)
|
||||
|
||||
exploreWokaTxt.text = getString(R.string.explore_woka)
|
||||
comingSoonTxt.text = getString(R.string.coming_soonn_on_woka)
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateUserData(data: UserDataResponse?) {
|
||||
binding.apply {
|
||||
val name = if (WokaApp.userPrefs?.userType == UserType.GUEST) WokaApp.userPrefs?.guestUserName
|
||||
else data?.result?.fullname
|
||||
|
||||
if (!name.isNullOrEmpty()) {
|
||||
val text = ", ${name.split(" ")[0]}"
|
||||
userName.text = text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
fun newInstance() = Home2Fragment()
|
||||
}
|
||||
|
||||
110
app/src/main/java/com/woka/utils/PressableCard.kt
Normal file
@@ -0,0 +1,110 @@
|
||||
package com.woka.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.util.Log
|
||||
import android.view.MotionEvent
|
||||
import android.view.MotionEvent.ACTION_CANCEL
|
||||
import android.view.MotionEvent.ACTION_DOWN
|
||||
import android.view.MotionEvent.ACTION_OUTSIDE
|
||||
import android.view.MotionEvent.ACTION_SCROLL
|
||||
import android.view.MotionEvent.ACTION_UP
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.FrameLayout
|
||||
import android.widget.ScrollView
|
||||
import androidx.core.view.ScrollingView
|
||||
import com.woka.R
|
||||
import kotlin.math.abs
|
||||
|
||||
class PressableCard : FrameLayout {
|
||||
|
||||
companion object {
|
||||
private const val DEFAULT_SCALE_WHEN_PRESS = 0.9f
|
||||
private const val DEFAULT_SCALE = 1f
|
||||
|
||||
private const val DEFAULT_ALPHA_WHEN_PRESS = 0.5f
|
||||
private const val DEFAULT_ALPHA = 1f
|
||||
|
||||
private const val MIN_MOMENT_AFTER_TOUCH = 25f
|
||||
}
|
||||
|
||||
enum class PressableType(value: Int){
|
||||
SCALE(0), FADE(1);
|
||||
}
|
||||
|
||||
constructor(context: Context?) : super(context!!)
|
||||
constructor(context: Context?, attrs: AttributeSet?) : super(
|
||||
context!!, attrs
|
||||
){
|
||||
setPressType(attrs)
|
||||
}
|
||||
|
||||
constructor(context: Context?, attrs: AttributeSet?, defStyle: Int) : super(
|
||||
context!!, attrs, defStyle
|
||||
) {
|
||||
setPressType(attrs)
|
||||
}
|
||||
|
||||
// attributes
|
||||
private var pressType: PressableType? = PressableType.SCALE
|
||||
|
||||
private fun setPressType(attrs: AttributeSet?){
|
||||
val attributes = context.obtainStyledAttributes(attrs, R.styleable.PressableCard)
|
||||
val value = attributes.getInt(R.styleable.PressableCard_pressType, 0)
|
||||
pressType = when(value){
|
||||
1 -> PressableType.FADE
|
||||
else -> PressableType.SCALE
|
||||
}
|
||||
attributes.recycle()
|
||||
}
|
||||
|
||||
private fun refresh() {
|
||||
if (isPressed) {
|
||||
if (pressType == PressableType.SCALE){
|
||||
scaleX = (DEFAULT_SCALE_WHEN_PRESS)
|
||||
scaleY = (DEFAULT_SCALE_WHEN_PRESS)
|
||||
}else if (pressType == PressableType.FADE){
|
||||
alpha = DEFAULT_ALPHA_WHEN_PRESS
|
||||
}
|
||||
invalidate()
|
||||
return
|
||||
}
|
||||
if (pressType == PressableType.SCALE){
|
||||
scaleX = (DEFAULT_SCALE)
|
||||
scaleY = (DEFAULT_SCALE)
|
||||
}else if (pressType == PressableType.FADE){
|
||||
alpha = DEFAULT_ALPHA
|
||||
}
|
||||
invalidate()
|
||||
}
|
||||
|
||||
override fun setPressed(pressed: Boolean) {
|
||||
super.setPressed(pressed)
|
||||
refresh()
|
||||
}
|
||||
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
|
||||
when (event.action){
|
||||
ACTION_DOWN -> setPressed(true)
|
||||
ACTION_UP -> {
|
||||
setPressed(false)
|
||||
val x = event.x
|
||||
val y = event.y
|
||||
val isInside = x > 0 && x < width && y > 0 && y < height
|
||||
if (isInside) {
|
||||
performClick()
|
||||
}
|
||||
}
|
||||
ACTION_CANCEL -> setPressed(false)
|
||||
ACTION_SCROLL -> setPressed(false)
|
||||
ACTION_OUTSIDE -> setPressed(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override fun performClick(): Boolean {
|
||||
return super.performClick()
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.woka.home
|
||||
package com.woka.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
@@ -33,16 +33,20 @@ class PressableImageView : AppCompatImageView {
|
||||
}
|
||||
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
if (event.action == MotionEvent.ACTION_DOWN) {
|
||||
setPressed(true)
|
||||
} else if (event.action == MotionEvent.ACTION_UP) {
|
||||
setPressed(false)
|
||||
val x = event.x
|
||||
val y = event.y
|
||||
val isInside = x > 0 && x < width && y > 0 && y < height
|
||||
if (isInside) {
|
||||
performClick()
|
||||
when (event.action){
|
||||
MotionEvent.ACTION_DOWN -> setPressed(true)
|
||||
MotionEvent.ACTION_UP -> {
|
||||
setPressed(false)
|
||||
val x = event.x
|
||||
val y = event.y
|
||||
val isInside = x > 0 && x < width && y > 0 && y < height
|
||||
if (isInside) {
|
||||
performClick()
|
||||
}
|
||||
}
|
||||
MotionEvent.ACTION_CANCEL -> setPressed(false)
|
||||
MotionEvent.ACTION_SCROLL -> setPressed(false)
|
||||
MotionEvent.ACTION_OUTSIDE -> setPressed(false)
|
||||
}
|
||||
return true
|
||||
}
|
||||
BIN
app/src/main/res/drawable-hdpi/img_audio_books_t2.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
app/src/main/res/drawable-hdpi/img_karaoke_t2.png
Normal file
|
After Width: | Height: | Size: 38 KiB |
BIN
app/src/main/res/drawable-hdpi/img_live_tv_t2.png
Normal file
|
After Width: | Height: | Size: 45 KiB |
BIN
app/src/main/res/drawable-hdpi/img_play_t2.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
app/src/main/res/drawable-hdpi/img_shop_t2.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
app/src/main/res/drawable-hdpi/img_web_series_t2.png
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
app/src/main/res/drawable-hdpi/img_woka_fm_t2.png
Normal file
|
After Width: | Height: | Size: 32 KiB |
BIN
app/src/main/res/drawable-ldpi/img_audio_books_t2.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable-ldpi/img_karaoke_t2.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
app/src/main/res/drawable-ldpi/img_live_tv_t2.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
app/src/main/res/drawable-ldpi/img_play_t2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable-ldpi/img_shop_t2.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable-ldpi/img_web_series_t2.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
app/src/main/res/drawable-ldpi/img_woka_fm_t2.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
app/src/main/res/drawable-mdpi/img_audio_books_t2.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable-mdpi/img_karaoke_t2.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
BIN
app/src/main/res/drawable-mdpi/img_live_tv_t2.png
Normal file
|
After Width: | Height: | Size: 24 KiB |
BIN
app/src/main/res/drawable-mdpi/img_play_t2.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
app/src/main/res/drawable-mdpi/img_shop_t2.png
Normal file
|
After Width: | Height: | Size: 30 KiB |
BIN
app/src/main/res/drawable-mdpi/img_web_series_t2.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
app/src/main/res/drawable-mdpi/img_woka_fm_t2.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
app/src/main/res/drawable-xhdpi/img_audio_books_t2.png
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
app/src/main/res/drawable-xhdpi/img_karaoke_t2.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
app/src/main/res/drawable-xhdpi/img_live_tv_t2.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
app/src/main/res/drawable-xhdpi/img_play_t2.png
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
app/src/main/res/drawable-xhdpi/img_shop_t2.png
Normal file
|
After Width: | Height: | Size: 89 KiB |
BIN
app/src/main/res/drawable-xhdpi/img_web_series_t2.png
Normal file
|
After Width: | Height: | Size: 43 KiB |
BIN
app/src/main/res/drawable-xhdpi/img_woka_fm_t2.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
app/src/main/res/drawable-xxhdpi/img_audio_books_t2.png
Normal file
|
After Width: | Height: | Size: 119 KiB |
BIN
app/src/main/res/drawable-xxhdpi/img_karaoke_t2.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
app/src/main/res/drawable-xxhdpi/img_live_tv_t2.png
Normal file
|
After Width: | Height: | Size: 137 KiB |
BIN
app/src/main/res/drawable-xxhdpi/img_play_t2.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
app/src/main/res/drawable-xxhdpi/img_shop_t2.png
Normal file
|
After Width: | Height: | Size: 192 KiB |
BIN
app/src/main/res/drawable-xxhdpi/img_web_series_t2.png
Normal file
|
After Width: | Height: | Size: 131 KiB |
BIN
app/src/main/res/drawable-xxhdpi/img_woka_fm_t2.png
Normal file
|
After Width: | Height: | Size: 93 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/img_audio_books_t2.png
Normal file
|
After Width: | Height: | Size: 186 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/img_karaoke_t2.png
Normal file
|
After Width: | Height: | Size: 180 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/img_live_tv_t2.png
Normal file
|
After Width: | Height: | Size: 224 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/img_play_t2.png
Normal file
|
After Width: | Height: | Size: 196 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/img_shop_t2.png
Normal file
|
After Width: | Height: | Size: 293 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/img_web_series_t2.png
Normal file
|
After Width: | Height: | Size: 208 KiB |
BIN
app/src/main/res/drawable-xxxhdpi/img_woka_fm_t2.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
@@ -16,7 +16,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/notifications"
|
||||
android:visibility="visible"
|
||||
android:layout_width="@dimen/_35sdp"
|
||||
@@ -35,7 +35,7 @@
|
||||
android:scaleType="fitXY"
|
||||
/>
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/side_menu"
|
||||
android:layout_width="@dimen/_35sdp"
|
||||
android:layout_height="@dimen/_35sdp"
|
||||
@@ -83,9 +83,10 @@
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_marginTop="45dp"
|
||||
android:scrollbars="none"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingBottom="10dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
@@ -621,6 +622,14 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
|
||||
android:background="@color/woka_sky_blue"
|
||||
android:layout_marginVertical="8dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
@@ -8,14 +8,6 @@
|
||||
android:background="@color/color_primary"
|
||||
tools:context=".home.fragments.Home1Fragment">
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/g1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
@@ -23,9 +15,542 @@
|
||||
android:src="@drawable/primary_bg"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@id/g1"
|
||||
app:layout_constraintTop_toBottomOf="@id/g2"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profile_image"
|
||||
android:layout_width="@dimen/_38ssp"
|
||||
android:layout_height="@dimen/_38ssp"
|
||||
android:contentDescription="@string/image"
|
||||
|
||||
android:src="@drawable/profile_placeholder"
|
||||
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
|
||||
android:gravity="center_vertical"
|
||||
|
||||
app:layout_constraintStart_toEndOf="@id/profile_image"
|
||||
app:layout_constraintTop_toTopOf="@id/profile_image"
|
||||
app:layout_constraintBottom_toBottomOf="@id/profile_image"
|
||||
|
||||
android:layout_marginStart="10dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/user_name_LL"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="top"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/hello_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/hello"
|
||||
android:layout_marginTop="3dp"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/white"
|
||||
|
||||
android:textSize="@dimen/_16ssp"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/user_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
tools:text=", Aditya"
|
||||
android:layout_marginTop="3dp"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/white"
|
||||
|
||||
android:textSize="@dimen/_16ssp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/welcome_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:fontFamily="@font/exo_2"
|
||||
android:text="@string/welcome_to_wokaland"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_11ssp"
|
||||
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:layout_constraintBottom_toTopOf="@id/tv_view"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/user_name_LL"
|
||||
|
||||
app:layout_constraintVertical_bias="0" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.cardview.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginHorizontal="5dp"
|
||||
|
||||
app:cardCornerRadius="10dp"
|
||||
app:cardBackgroundColor="@color/white"
|
||||
|
||||
app:layout_constraintBottom_toTopOf="@id/g1"
|
||||
app:layout_constraintTop_toBottomOf="@id/profile_image">
|
||||
|
||||
<View
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:background="@android:color/holo_green_dark"
|
||||
|
||||
android:layout_margin="5dp"
|
||||
/>
|
||||
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/g1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.35"/>
|
||||
|
||||
<androidx.constraintlayout.widget.Guideline
|
||||
android:id="@+id/g2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.55"/>
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
|
||||
app:layout_constraintTop_toBottomOf="@id/g1"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
|
||||
android:layout_marginTop="10dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/explore_woka_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/explore_woka"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
|
||||
/>
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/woka_fm"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
app:pressType="scale"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="111.36dp"
|
||||
android:layout_height="137dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:contentDescription="@string/woka_fm"
|
||||
android:src="@drawable/img_woka_fm_t2"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/woka_fm_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/woka_fm"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintVertical_bias="0.85"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/live_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
app:pressType="scale"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="111.36dp"
|
||||
android:layout_height="137dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:contentDescription="@string/woka_fm"
|
||||
android:src="@drawable/img_live_tv_t2"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/live_tv_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/live_tv"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintVertical_bias="0.85"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/web_series"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
app:pressType="fade"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="111.36dp"
|
||||
android:layout_height="137dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:contentDescription="@string/woka_fm"
|
||||
android:src="@drawable/img_web_series_t2"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/web_series_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/web_series"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintVertical_bias="0.85"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/play_games"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
app:pressType="scale"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="111.36dp"
|
||||
android:layout_height="137dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:contentDescription="@string/woka_fm"
|
||||
android:src="@drawable/img_play_t2"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/games_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/games"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintVertical_bias="0.85"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/audio_books"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
app:pressType="scale"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="111.36dp"
|
||||
android:layout_height="137dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:contentDescription="@string/woka_fm"
|
||||
android:src="@drawable/img_audio_books_t2"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/audio_books_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/audio_books"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintVertical_bias="0.85"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/karaoke"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
app:pressType="scale"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="111.36dp"
|
||||
android:layout_height="137dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:contentDescription="@string/karaoke"
|
||||
android:src="@drawable/img_karaoke_t2"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/karaoke_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/karaoke"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintVertical_bias="0.85"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
<com.woka.utils.PressableCard
|
||||
android:id="@+id/shop"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
app:pressType="scale"
|
||||
>
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="111.36dp"
|
||||
android:layout_height="137dp"
|
||||
>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
|
||||
android:contentDescription="@string/woka_fm"
|
||||
android:src="@drawable/img_shop_t2"
|
||||
android:scaleType="fitXY"
|
||||
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/shop_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/shop"
|
||||
android:textColor="@color/white"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textAlignment="center"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
||||
app:layout_constraintVertical_bias="0.85"
|
||||
|
||||
/>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.woka.utils.PressableCard>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</HorizontalScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/coming_soon_txt"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:text="@string/coming_soonn_on_woka"
|
||||
android:fontFamily="@font/exo_2_bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/_16ssp"
|
||||
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
@@ -7,7 +7,7 @@
|
||||
tools:background="@drawable/grad_evening"
|
||||
tools:context=".home.fragments.Home1Fragment">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/fm_button"
|
||||
android:layout_width="@dimen/_70sdp"
|
||||
android:layout_height="@dimen/_70sdp"
|
||||
@@ -282,7 +282,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/g1"
|
||||
app:layout_constraintVertical_bias="0.25">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/web_series"
|
||||
android:layout_width="@dimen/_75sdp"
|
||||
android:layout_height="@dimen/_62sdp"
|
||||
@@ -324,7 +324,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/g1"
|
||||
app:layout_constraintVertical_bias="0.2">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/live_tv"
|
||||
android:layout_width="@dimen/_75sdp"
|
||||
android:layout_height="@dimen/_62sdp"
|
||||
@@ -367,7 +367,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/g1"
|
||||
app:layout_constraintVertical_bias="0.05">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/shop"
|
||||
android:layout_width="@dimen/_75sdp"
|
||||
android:layout_height="@dimen/_62sdp"
|
||||
@@ -410,7 +410,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/g1"
|
||||
app:layout_constraintVertical_bias="0.59">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/karaoke"
|
||||
android:layout_width="@dimen/_75sdp"
|
||||
android:layout_height="@dimen/_62sdp"
|
||||
@@ -453,7 +453,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/g1"
|
||||
app:layout_constraintVertical_bias="0.6">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/audio_books"
|
||||
android:layout_width="@dimen/_75sdp"
|
||||
android:layout_height="@dimen/_62sdp"
|
||||
@@ -496,7 +496,7 @@
|
||||
app:layout_constraintTop_toTopOf="@id/g1"
|
||||
app:layout_constraintVertical_bias="0.39">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:id="@+id/play"
|
||||
android:layout_width="@dimen/_75sdp"
|
||||
android:layout_height="@dimen/_62sdp"
|
||||
@@ -534,7 +534,7 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<com.woka.home.PressableImageView
|
||||
<com.woka.utils.PressableImageView
|
||||
android:layout_width="25dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/more"
|
||||
|
||||
@@ -113,4 +113,7 @@
|
||||
<string name="login_register">लॉगइन / रजिस्टर करें</string>
|
||||
<string name="logging_you_out">लॉग आउट कर रहे हैं</string>
|
||||
<string name="do_you_want_to_log_out">क्या आप Woka ऐप से लॉग आउट करना चाहते हैं?</string>
|
||||
<string name="woka_fm">वोका एफएम</string>
|
||||
<string name="games">खेल</string>
|
||||
<string name="coming_soonn_on_woka">जल्द ही Woka पर आ रहा है</string>
|
||||
</resources>
|
||||
11
app/src/main/res/values/custom_resources.xml
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<declare-styleable name="PressableCard">
|
||||
<attr name="pressType" format="enum">
|
||||
<enum name="fade" value="1"/>
|
||||
<enum name="scale" value="0"/>
|
||||
</attr>
|
||||
</declare-styleable>
|
||||
|
||||
</resources>
|
||||
@@ -131,4 +131,7 @@
|
||||
<string name="logging_you_out">Logging you out</string>
|
||||
<string name="woka" translatable="false">Woka</string>
|
||||
<string name="do_you_want_to_log_out">Do you want to log out of Woka app?</string>
|
||||
<string name="woka_fm">WOKA FM</string>
|
||||
<string name="games">GAMES</string>
|
||||
<string name="coming_soonn_on_woka">Coming soonn on Woka</string>
|
||||
</resources>
|
||||