-
Notifications
You must be signed in to change notification settings - Fork 372
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
be53488
commit a819b61
Showing
20 changed files
with
671 additions
and
402 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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
## 更新日志 | ||
|
||
### v1.3.2 | ||
|
||
* 固定遠程配置端口為34567 | ||
* 優化配置樣式 | ||
* 可配置是否顯示全部頻道 | ||
|
||
### v1.3.1 | ||
|
||
* 恢復默認後,立即更新視頻源 | ||
|
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 |
---|---|---|
|
@@ -80,8 +80,6 @@ adb install my-tv-0.apk | |
* 支持回看 | ||
* 詳細EPG | ||
* 淺色菜單 | ||
* 是否顯示全部頻道 | ||
* 固定網絡配置端口 | ||
* 無效的頻道? | ||
|
||
## 讚賞 | ||
|
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
34 changes: 34 additions & 0 deletions
34
app/src/main/java/com/lizongying/mytv0/LocaleContextWrapper.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,34 @@ | ||
package com.lizongying.mytv0 | ||
|
||
import android.content.Context | ||
import android.content.ContextWrapper | ||
import android.os.Build | ||
import android.os.LocaleList | ||
import java.util.Locale | ||
|
||
class LocaleContextWrapper(base: Context) : ContextWrapper(base) { | ||
companion object { | ||
fun wrap(context: Context, newLocale: Locale): ContextWrapper { | ||
val resources = context.resources | ||
val configuration = resources.configuration | ||
|
||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { | ||
configuration.setLocale(newLocale) | ||
val localeList = LocaleList(newLocale) | ||
LocaleList.setDefault(localeList) | ||
configuration.setLocales(localeList) | ||
} else { | ||
configuration.locale = newLocale | ||
} | ||
|
||
val updatedContext = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N_MR1) { | ||
context.createConfigurationContext(configuration) | ||
} else { | ||
resources.updateConfiguration(configuration, resources.displayMetrics) | ||
context | ||
} | ||
|
||
return LocaleContextWrapper(updatedContext) | ||
} | ||
} | ||
} |
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
Oops, something went wrong.