Skip to content

Commit 0e21321

Browse files
authored
Merge pull request #106 from winstonsung/dev-106
Fix various color and margin/padding issues
2 parents 74561c3 + 12bc77e commit 0e21321

File tree

14 files changed

+69
-19
lines changed

14 files changed

+69
-19
lines changed

app/src/main/java/app/opass/ccip/ui/LanguagePreferenceFragment.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import androidx.fragment.app.FragmentManager
1515
import androidx.recyclerview.widget.LinearLayoutManager
1616
import androidx.recyclerview.widget.RecyclerView
1717
import app.opass.ccip.R
18+
import app.opass.ccip.extension.updateMargin
1819
import com.google.android.material.dialog.MaterialAlertDialogBuilder
1920

2021
class LanguagePreferenceFragment : DialogFragment() {
@@ -140,6 +141,14 @@ class LanguagePreferenceAdapter(
140141
holder.localName.text = item.localName
141142
holder.translatedName.text = item.translatedName
142143

144+
if (position == 0) {
145+
holder.optionItem.updateMargin(top = 36)
146+
}
147+
148+
if (position == items.size - 1) {
149+
holder.optionItem.updateMargin(bottom = 36)
150+
}
151+
143152
if (!isSelected) {
144153
holder.selectedIcon.setImageDrawable(null)
145154
} else {

app/src/main/java/app/opass/ccip/ui/wifi/WiFiNetworkAdapter.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@ package app.opass.ccip.ui.wifi
33
import android.view.LayoutInflater
44
import android.view.View
55
import android.view.ViewGroup
6+
import android.widget.LinearLayout
67
import android.widget.TextView
78
import androidx.core.view.isGone
9+
import androidx.core.view.marginTop
810
import androidx.recyclerview.widget.RecyclerView
911
import app.opass.ccip.R
12+
import app.opass.ccip.extension.updateMargin
1013
import app.opass.ccip.model.WifiNetworkInfo
1114

1215
class WifiNetworkAdapter(
@@ -38,10 +41,19 @@ class WifiNetworkAdapter(
3841

3942
holder.password.text = item.password
4043
holder.password.isGone = false
44+
45+
if (position == 0) {
46+
holder.networkItem.updateMargin(top = 36)
47+
}
48+
49+
if (position == items.size - 1) {
50+
holder.networkItem.updateMargin(bottom = 36)
51+
}
4152
}
4253
}
4354

4455
class WifiNetworkViewHolder(view: View) : RecyclerView.ViewHolder(view) {
56+
val networkItem: LinearLayout = view.findViewById(R.id.network_item)
4557
val name: TextView = view.findViewById(R.id.network_name)
4658
val password: TextView = view.findViewById(R.id.network_password)
4759
}

app/src/main/res/drawable/room_background.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<selector xmlns:android="http://schemas.android.com/apk/res/android">
33
<item>
44
<shape android:shape="oval">
5-
<solid android:color="@color/colorPrimary" />
5+
<solid android:color="@color/backgroundColorAccent" />
66
</shape>
77
</item>
88
</selector>

app/src/main/res/drawable/tag_round_corner.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<shape xmlns:android="http://schemas.android.com/apk/res/android"
33
android:shape="rectangle">
44

5-
<solid android:color="?attr/colorAccent" />
5+
<solid android:color="@color/colorAccentDark" />
66

77
<corners android:radius="16dp" />
88
</shape>

app/src/main/res/layout/activity_session_detail.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
android:layout_height="wrap_content"
6666
android:layout_margin="@dimen/fab_margin"
6767
android:src="@drawable/ic_star_border_white_48dp"
68+
app:backgroundTint="@color/colorPrimary"
6869
app:layout_anchor="@id/app_bar"
6970
app:layout_anchorGravity="bottom|end" />
7071

app/src/main/res/layout/fragment_schedule_tab.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
android:layout_gravity="bottom|end"
2727
android:layout_margin="16dp"
2828
android:contentDescription="@string/filter"
29-
android:tint="?attr/colorOnSecondary"
29+
app:backgroundTint="@color/colorPrimary"
30+
android:tint="?attr/colorOnPrimary"
3031
android:visibility="invisible"
3132
app:srcCompat="@drawable/ic_baseline_filter_list_24" />
3233

app/src/main/res/layout/include_auth_header.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
<Button
2020
android:id="@+id/not_this_event"
21-
style="@style/Widget.MaterialComponents.Button.TextButton"
21+
style="@style/TextButton"
2222
android:layout_width="wrap_content"
2323
android:layout_height="wrap_content"
2424
android:layout_gravity="center_horizontal"

app/src/main/res/layout/item_event.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323
<RelativeLayout
2424
android:layout_width="match_parent"
2525
android:layout_height="150dp"
26-
android:background="?attr/colorSecondary">
26+
android:background="@color/backgroundColorAccent">
2727

2828
<ImageView
2929
android:id="@+id/event_logo"
3030
android:layout_width="wrap_content"
3131
android:layout_height="wrap_content"
3232
android:layout_centerInParent="true"
3333
android:padding="10dp"
34-
card_view:srcCompat="?attr/colorSecondary" />
34+
card_view:srcCompat="@color/backgroundColorAccent" />
3535
</RelativeLayout>
3636

3737
<TextView

app/src/main/res/layout/item_option_language.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,15 @@
99
android:background="?attr/selectableItemBackground"
1010
android:focusable="true"
1111
android:orientation="horizontal"
12-
android:paddingStart="32dp"
13-
android:paddingTop="16dp"
14-
android:paddingEnd="16dp"
15-
android:paddingBottom="16dp">
12+
android:paddingTop="8dp"
13+
android:paddingBottom="8dp"
14+
android:paddingStart="24dp"
15+
android:paddingEnd="24dp">
1616

1717
<LinearLayout
1818
android:layout_weight="1"
1919
android:layout_width="0dp"
2020
android:layout_height="wrap_content"
21-
android:background="?attr/selectableItemBackground"
22-
android:focusable="true"
2321
android:orientation="vertical">
2422
<TextView
2523
android:id="@+id/option_local_name"

app/src/main/res/layout/item_session.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@
2929
android:layout_marginStart="12dp"
3030
android:layout_marginTop="8dp"
3131
android:autoSizeTextType="uniform"
32+
android:autoSizeMinTextSize="8dp"
3233
android:maxLines="1"
3334
android:padding="2dp"
34-
android:text="New Text"
35+
android:text="TR412-1"
3536
app:layout_constraintBottom_toTopOf="@id/tagsBarrier"
3637
app:layout_constraintStart_toStartOf="parent"
3738
app:layout_constraintTop_toTopOf="parent" />

0 commit comments

Comments
 (0)