-
Notifications
You must be signed in to change notification settings - Fork 12
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
Showing
57 changed files
with
273 additions
and
366 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: 'Close stale issues and PRs' | ||
on: | ||
schedule: | ||
- cron: '0 16 * * *' | ||
|
||
jobs: | ||
stale: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/stale@v5 | ||
with: | ||
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.' | ||
days-before-stale: 30 | ||
days-before-close: 5 | ||
exempt-all-pr-milestones: true | ||
exempt-issue-labels: 'help wanted' |
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
Binary file not shown.
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
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
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
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 |
---|---|---|
|
@@ -2,8 +2,6 @@ package com.king.template.app.home | |
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.core.content.ContextCompat | ||
import androidx.recyclerview.widget.DividerItemDecoration | ||
import androidx.recyclerview.widget.LinearLayoutManager | ||
|
@@ -14,14 +12,13 @@ import com.king.template.app.Constants | |
import com.king.template.app.adapter.BannerImageAdapter | ||
import com.king.template.app.adapter.BaseBindingAdapter | ||
import com.king.template.app.base.BaseFragment | ||
import com.king.template.bean.BannerBean | ||
import com.king.template.bean.Bean | ||
import com.king.template.data.model.BannerBean | ||
import com.king.template.data.model.Bean | ||
import com.king.template.databinding.HomeFragmentBinding | ||
import com.youth.banner.Banner | ||
import com.youth.banner.config.IndicatorConfig | ||
import com.youth.banner.indicator.CircleIndicator | ||
import dagger.hilt.android.AndroidEntryPoint | ||
import timber.log.Timber | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Jenly</a> | ||
|
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
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
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
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/king/template/data/local/AppDatabase.kt
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,22 @@ | ||
package com.king.template.data.local | ||
|
||
import androidx.room.Database | ||
import androidx.room.RoomDatabase | ||
import com.king.template.data.local.dao.SearchHistoryDao | ||
import com.king.template.data.model.entity.SearchHistory | ||
|
||
/** | ||
* 数据库 | ||
* | ||
* @author <a href="mailto:[email protected]">Jenly</a> | ||
* <p> | ||
* <a href="https://github.com/jenly1314">Follow me</a> | ||
*/ | ||
@Database(entities = [SearchHistory::class], version = 1, exportSchema = false) | ||
abstract class AppDatabase : RoomDatabase() { | ||
|
||
/** | ||
* SearchHistoryDao | ||
*/ | ||
abstract val searchHistoryDao: SearchHistoryDao | ||
} |
39 changes: 39 additions & 0 deletions
39
app/src/main/java/com/king/template/data/local/dao/SearchHistoryDao.kt
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,39 @@ | ||
package com.king.template.data.local.dao | ||
|
||
import androidx.room.Dao | ||
import androidx.room.Insert | ||
import androidx.room.OnConflictStrategy | ||
import androidx.room.Query | ||
import com.king.template.data.model.entity.SearchHistory | ||
import kotlinx.coroutines.flow.Flow | ||
|
||
/** | ||
* 搜索历史 | ||
* | ||
* @author <a href="mailto:[email protected]">Jenly</a> | ||
* <p> | ||
* <a href="https://github.com/jenly1314">Follow me</a> | ||
*/ | ||
@Dao | ||
interface SearchHistoryDao { | ||
/** | ||
* 插入一条历史数据 | ||
* @param searchHistory | ||
*/ | ||
@Insert(onConflict = OnConflictStrategy.REPLACE) | ||
suspend fun insert(searchHistory: SearchHistory) | ||
|
||
/** | ||
* 删除所有历史数据 | ||
*/ | ||
@Query("DELETE FROM SearchHistory") | ||
suspend fun deleteAll() | ||
|
||
/** | ||
* 获取历史数据对应的[Flow] | ||
* | ||
* @param count 获取历史记录的条数 | ||
*/ | ||
@Query("SELECT * FROM SearchHistory ORDER BY timestamp DESC LIMIT :count") | ||
fun getHistoryFlow(count: Int): Flow<List<SearchHistory>?> | ||
} |
2 changes: 1 addition & 1 deletion
2
...java/com/king/template/bean/BannerBean.kt → ...om/king/template/data/model/BannerBean.kt
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
2 changes: 1 addition & 1 deletion
2
...ava/com/king/template/bean/BannerImage.kt → ...m/king/template/data/model/BannerImage.kt
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,4 +1,4 @@ | ||
package com.king.template.bean | ||
package com.king.template.data.model | ||
|
||
/** | ||
* @author <a href="mailto:[email protected]">Jenly</a> | ||
|
Oops, something went wrong.