Skip to content

Commit 4eb89aa

Browse files
committed
Change the prefix for resource names to 'ycdev'
1 parent c21b94c commit 4eb89aa

27 files changed

+160
-159
lines changed

uiLib/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ android {
1111
minSdkVersion versions.minSdk
1212
}
1313

14+
resourcePrefix 'ycdev'
1415
viewBinding.enabled = true
1516

1617
lintOptions {

uiLib/src/main/java/me/ycdev/android/lib/commonui/activity/GridEntriesActivity.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import me.ycdev.android.lib.common.utils.IntentUtils.INTENT_TYPE_ACTIVITY
2020
import me.ycdev.android.lib.common.utils.IntentUtils.INTENT_TYPE_BROADCAST
2121
import me.ycdev.android.lib.common.wrapper.BroadcastHelper
2222
import me.ycdev.android.lib.commonui.R
23-
import me.ycdev.android.lib.commonui.databinding.CommonuiGridEntriesItemBinding
23+
import me.ycdev.android.lib.commonui.databinding.YcdevGridEntriesItemBinding
2424
import me.ycdev.android.lib.commonui.recyclerview.MarginItemDecoration
2525

2626
@Suppress("MemberVisibilityCanBePrivate", "unused")
@@ -31,7 +31,7 @@ abstract class GridEntriesActivity : AppCompatActivity() {
3131
protected lateinit var loadingView: ProgressBar
3232

3333
protected open val contentViewLayout: Int
34-
@LayoutRes get() = R.layout.commonui_grid_entries
34+
@LayoutRes get() = R.layout.ycdev_grid_entries
3535

3636
protected abstract val intents: List<Entry>
3737

@@ -91,7 +91,7 @@ abstract class GridEntriesActivity : AppCompatActivity() {
9191
}
9292

9393
open fun getGridEntriesMargin(): Int {
94-
val a = obtainStyledAttributes(intArrayOf(R.attr.commonuiGridEntriesItemMargin))
94+
val a = obtainStyledAttributes(intArrayOf(R.attr.ycdevGridEntriesItemMargin))
9595
val margin: Int = a.getDimensionPixelSize(0, 0)
9696
a.recycle()
9797
return margin
@@ -140,7 +140,7 @@ abstract class GridEntriesActivity : AppCompatActivity() {
140140

141141
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
142142
val itemView = LayoutInflater.from(context)
143-
.inflate(R.layout.commonui_grid_entries_item, parent, false)
143+
.inflate(R.layout.ycdev_grid_entries_item, parent, false)
144144
return ViewHolder(itemView)
145145
}
146146

@@ -156,7 +156,7 @@ abstract class GridEntriesActivity : AppCompatActivity() {
156156
}
157157

158158
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
159-
val binding: CommonuiGridEntriesItemBinding = CommonuiGridEntriesItemBinding.bind(itemView)
159+
val binding: YcdevGridEntriesItemBinding = YcdevGridEntriesItemBinding.bind(itemView)
160160
}
161161
}
162162
}

uiLib/src/main/java/me/ycdev/android/lib/commonui/base/LoadingAsyncTaskBase.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import me.ycdev.android.lib.commonui.R
88
abstract class LoadingAsyncTaskBase<Params, Result> : WaitingAsyncTaskBase<Params, Int, Result> {
99

1010
override val initMessage: String
11-
get() = activity.getString(R.string.commonui_tips_loading_percent, 0)
11+
get() = activity.getString(R.string.ycdev_tips_loading_percent, 0)
1212

1313
constructor(activity: Activity) : super(activity)
1414

@@ -21,7 +21,7 @@ abstract class LoadingAsyncTaskBase<Params, Result> : WaitingAsyncTaskBase<Param
2121
override fun onProgressUpdate(vararg values: Int?) {
2222
val percent = values[0]
2323
if (dialog.isShowing) {
24-
dialog.setMessage(activity.getString(R.string.commonui_tips_loading_percent, percent))
24+
dialog.setMessage(activity.getString(R.string.ycdev_tips_loading_percent, percent))
2525
}
2626
}
2727
}

uiLib/src/main/java/me/ycdev/android/lib/commonui/base/WaitingAsyncTaskBase.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ abstract class WaitingAsyncTaskBase<Params, Progress, Result> constructor(
1919
protected lateinit var dialog: ProgressDialog
2020

2121
protected open val initMessage: String
22-
get() = activity.getString(R.string.commonui_tips_loading)
22+
get() = activity.getString(R.string.ycdev_tips_loading)
2323

2424
fun setAutoFinishWhenCanceled(autoFinishWhenCanceled: Boolean) {
2525
mAutoFinishWhenCanceled = autoFinishWhenCanceled

uiLib/src/main/res/drawable/commonui_grid_entries_item_bkg.xml

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
<item android:drawable="@color/ycdev_grid_entries_item_bkg_pressed" android:state_pressed="true"/>
5+
<item android:drawable="@color/ycdev_grid_entries_item_bkg_focused" android:state_focused="true"/>
6+
<item android:drawable="@color/ycdev_grid_entries_item_bkg_normal"/>
7+
8+
</selector>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3-
<item android:drawable="@drawable/commonui_scrollbar_thumb_normal" />
3+
<item android:drawable="@drawable/ycdev_scrollbar_thumb_normal" />
44
</selector>
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3-
<item android:drawable="@drawable/commonui_scrollbar_track_normal" />
3+
<item android:drawable="@drawable/ycdev_scrollbar_track_normal" />
44
</selector>

uiLib/src/main/res/layout/commonui_grid_entries.xml renamed to uiLib/src/main/res/layout/ycdev_grid_entries.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,27 @@
99
<com.google.android.material.appbar.AppBarLayout
1010
android:layout_width="match_parent"
1111
android:layout_height="wrap_content"
12-
android:theme="@style/AppTheme.AppBarOverlay">
12+
android:theme="@style/YcdevTheme.AppBarOverlay">
1313

1414
<androidx.appcompat.widget.Toolbar
1515
android:id="@+id/toolbar"
1616
android:layout_width="match_parent"
1717
android:layout_height="?attr/actionBarSize"
1818
android:background="?attr/colorPrimary"
19-
app:popupTheme="@style/AppTheme.PopupOverlay" />
19+
app:popupTheme="@style/YcdevTheme.PopupOverlay" />
2020

2121
</com.google.android.material.appbar.AppBarLayout>
2222

2323
<androidx.recyclerview.widget.RecyclerView
2424
android:id="@+id/grid"
25-
style="@style/Widget.CommonUiTheme.RecyclerView"
25+
style="@style/YcdevWidget.RecyclerView"
2626
android:layout_width="match_parent"
2727
android:layout_height="match_parent"
2828
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
2929

3030
<ProgressBar
3131
android:id="@+id/progress"
32-
android:layout_width="@dimen/commonui_page_center_progress_bar_size"
33-
android:layout_height="@dimen/commonui_page_center_progress_bar_size"
32+
android:layout_width="@dimen/ycdev_page_center_progress_bar_size"
33+
android:layout_height="@dimen/ycdev_page_center_progress_bar_size"
3434
android:layout_gravity="center" />
3535
</androidx.coordinatorlayout.widget.CoordinatorLayout>
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
33
android:id="@+id/title"
4-
style="?attr/commonuiGridEntriesItemStyle"
4+
style="?attr/ycdevGridEntriesItemStyle"
55
android:gravity="center" />

uiLib/src/main/res/values-w820dp/commonui_dimens.xml renamed to uiLib/src/main/res/values-w820dp/ycdev_dimens.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
44
(such as screen margins) for screens with more than 820dp of available width. This
55
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
6-
<dimen name="commonui_activity_horizontal_margin">64dp</dimen>
6+
<dimen name="ycdev_activity_horizontal_margin">64dp</dimen>
77
</resources>

uiLib/src/main/res/values/commonui_attrs.xml

-18
This file was deleted.

uiLib/src/main/res/values/commonui_colors.xml

-7
This file was deleted.

uiLib/src/main/res/values/commonui_dimens.xml

-14
This file was deleted.

uiLib/src/main/res/values/commonui_strings.xml

-6
This file was deleted.

uiLib/src/main/res/values/commonui_styles.xml

-54
This file was deleted.

uiLib/src/main/res/values/commonui_themes.xml

-23
This file was deleted.

uiLib/src/main/res/values/publics.xml

-12
This file was deleted.
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!-- Attrs for CommonUi theme BEGIN -->
4+
<attr name="ycdevActivityHorizontalMargin" format="dimension" />
5+
<attr name="ycdevActivityVerticalMargin" format="dimension" />
6+
7+
<attr name="ycdevDividerMargin" format="dimension" />
8+
<attr name="ycdevDividerColor" format="color" />
9+
10+
<attr name="ycdevGridEntriesItemStyle" format="reference" />
11+
<attr name="ycdevGridEntriesItemHeight" format="dimension" />
12+
<attr name="ycdevGridEntriesItemMargin" format="dimension" />
13+
<attr name="ycdevGridEntriesItemBkg" format="reference" />
14+
<attr name="ycdevGridEntriesItemTextAppearance" format="reference" />
15+
16+
<attr name="ycdevListItemVerticalMargin" format="dimension" />
17+
<!-- Attrs for CommonUi theme END -->
18+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="ycdev_divider_color">#00aaaa</color>
4+
<color name="ycdev_grid_entries_item_bkg_normal">#007777</color>
5+
<color name="ycdev_grid_entries_item_bkg_focused">#008888</color>
6+
<color name="ycdev_grid_entries_item_bkg_pressed">#00aaaa</color>
7+
</resources>
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<dimen name="ycdev_activity_horizontal_margin">10dp</dimen>
4+
<dimen name="ycdev_activity_vertical_margin">10dp</dimen>
5+
6+
<dimen name="ycdev_page_center_progress_bar_size">80dp</dimen>
7+
8+
<dimen name="ycdev_divider_margin">6dp</dimen>
9+
10+
<dimen name="ycdev_grid_entries_item_height">50dp</dimen>
11+
<dimen name="ycdev_grid_entries_item_margin">3dp</dimen>
12+
13+
<dimen name="ycdev_list_view_item_vertical_margin">6dp</dimen>
14+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<!--
4+
For "public & private resources",
5+
please refer https://developer.android.com/studio/projects/android-library.html#PrivateResources
6+
!-->
7+
<public type="string" name="ycdev_tips_loading" />
8+
<public type="string" name="ycdev_tips_loading_percent" />
9+
10+
<public type="attr" name="ycdevActivityHorizontalMargin" />
11+
<public type="attr" name="ycdevActivityVerticalMargin" />
12+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="ycdev_tips_loading">Loading…</string>
4+
<string name="ycdev_tips_loading_percent">Loading…%1$d%%</string>
5+
6+
</resources>

0 commit comments

Comments
 (0)