-
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
194713d
commit b96711e
Showing
6 changed files
with
58 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.hyc.parrot | ||
|
||
import android.annotation.SuppressLint | ||
import com.hyc.parrot_lib.PrefixProvider | ||
import java.text.SimpleDateFormat | ||
import java.util.Date | ||
|
||
/** | ||
* @author: 贺宇成 | ||
* @date: 2019-12-23 09:44 | ||
* @desc: | ||
*/ | ||
class MyPrefixProvider : PrefixProvider { | ||
|
||
companion object { | ||
const val DATE = "date" | ||
} | ||
|
||
@SuppressLint("SimpleDateFormat") | ||
override fun getKeyPrefix(key: String, prefixKey: String): String { | ||
if (prefixKey == DATE) { | ||
val date = Date() | ||
val format = SimpleDateFormat("yyyy-MM-dd") | ||
return format.format(date) | ||
} | ||
return "" | ||
} | ||
} |
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,19 +1,19 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" | ||
tools:context=".MainActivity"> | ||
|
||
<TextView | ||
android:layout_marginTop="100dp" | ||
android:layout_gravity="center_horizontal" | ||
android:id="@+id/tv_title" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:text="Hello World!" | ||
app:layout_constraintBottom_toBottomOf="parent" | ||
app:layout_constraintLeft_toLeftOf="parent" | ||
app:layout_constraintRight_toRightOf="parent" | ||
app:layout_constraintTop_toTopOf="parent" /> | ||
android:text="Hello World!" /> | ||
|
||
</android.support.constraint.ConstraintLayout> | ||
|
||
|
||
</LinearLayout> |
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