Fix tracker compilation
This commit is contained in:
parent
10e8ffdfa2
commit
ba569bb809
6 changed files with 62 additions and 54 deletions
|
@ -699,18 +699,20 @@ class TelegramSettings(private val app: TelegramApplication) {
|
|||
|
||||
val hiddenChats = mutableSetOf<Long>()
|
||||
val hiddenChatsSet = prefs.getStringSet(HIDDEN_ON_MAP_CHATS_KEY, mutableSetOf())
|
||||
for (chatId in hiddenChatsSet) {
|
||||
hiddenChats.add(chatId.toLong())
|
||||
hiddenChatsSet?.let {
|
||||
for (chatId in it) {
|
||||
hiddenChats.add(chatId.toLong())
|
||||
}
|
||||
}
|
||||
hiddenOnMapChats = hiddenChats
|
||||
|
||||
metricsConstants = MetricsConstants.valueOf(
|
||||
prefs.getString(METRICS_CONSTANTS_KEY, MetricsConstants.KILOMETERS_AND_METERS.name)
|
||||
prefs.getString(METRICS_CONSTANTS_KEY, MetricsConstants.KILOMETERS_AND_METERS.name)!!
|
||||
)
|
||||
speedConstants = SpeedConstants.valueOf(
|
||||
prefs.getString(SPEED_CONSTANTS_KEY, SpeedConstants.KILOMETERS_PER_HOUR.name)
|
||||
prefs.getString(SPEED_CONSTANTS_KEY, SpeedConstants.KILOMETERS_PER_HOUR.name)!!
|
||||
)
|
||||
utcOffset = prefs.getString(UTC_OFFSET_CONSTANTS_KEY, DataConstants.UTC_FORMAT)
|
||||
utcOffset = prefs.getString(UTC_OFFSET_CONSTANTS_KEY, DataConstants.UTC_FORMAT)!!
|
||||
|
||||
try {
|
||||
parseShareChatsInfo(JSONArray(prefs.getString(SHARE_CHATS_INFO_KEY, "")))
|
||||
|
@ -724,7 +726,7 @@ class TelegramSettings(private val app: TelegramApplication) {
|
|||
log.error(e)
|
||||
}
|
||||
|
||||
parseShareDevices(prefs.getString(SHARE_DEVICES_KEY, ""))
|
||||
parseShareDevices(prefs.getString(SHARE_DEVICES_KEY, "")!!)
|
||||
|
||||
val sendMyLocDef = SEND_MY_LOC_VALUES_SEC[SEND_MY_LOC_DEFAULT_INDEX]
|
||||
sendMyLocInterval = prefs.getLong(SEND_MY_LOC_INTERVAL_KEY, sendMyLocDef)
|
||||
|
@ -733,7 +735,7 @@ class TelegramSettings(private val app: TelegramApplication) {
|
|||
val locHistoryDef = LOC_HISTORY_VALUES_SEC[LOC_HISTORY_DEFAULT_INDEX]
|
||||
locHistoryTime = prefs.getLong(LOC_HISTORY_TIME_KEY, locHistoryDef)
|
||||
val shareTypeDef = SHARE_TYPE_VALUES[SHARE_TYPE_DEFAULT_INDEX]
|
||||
shareTypeValue = prefs.getString(SHARE_TYPE_KEY, shareTypeDef)
|
||||
shareTypeValue = prefs.getString(SHARE_TYPE_KEY, shareTypeDef)!!
|
||||
|
||||
val minLocationDistanceDef = MIN_LOCATION_DISTANCE[MIN_LOCATION_DISTANCE_INDEX]
|
||||
minLocationDistance = prefs.getFloat(MIN_LOCATION_DISTANCE_KEY, minLocationDistanceDef)
|
||||
|
@ -743,13 +745,13 @@ class TelegramSettings(private val app: TelegramApplication) {
|
|||
minLocationSpeed = prefs.getFloat(MIN_LOCATION_SPEED_KEY, minLocationSpeedDef)
|
||||
|
||||
val currentUserId = app.telegramHelper.getCurrentUserId()
|
||||
currentSharingMode = prefs.getString(SHARING_MODE_KEY, if (currentUserId != -1) currentUserId.toString() else "")
|
||||
currentSharingMode = prefs.getString(SHARING_MODE_KEY, if (currentUserId != -1) currentUserId.toString() else "")!!
|
||||
|
||||
val defPackage = if (AppConnect.getInstalledApps(app).size == 1) AppConnect.getInstalledApps(app).first().appPackage else ""
|
||||
appToConnectPackage = prefs.getString(APP_TO_CONNECT_PACKAGE_KEY, defPackage)
|
||||
appToConnectPackage = prefs.getString(APP_TO_CONNECT_PACKAGE_KEY, defPackage)!!
|
||||
|
||||
liveNowSortType = LiveNowSortType.valueOf(
|
||||
prefs.getString(LIVE_NOW_SORT_TYPE_KEY, LiveNowSortType.SORT_BY_DISTANCE.name)
|
||||
prefs.getString(LIVE_NOW_SORT_TYPE_KEY, LiveNowSortType.SORT_BY_DISTANCE.name)!!
|
||||
)
|
||||
|
||||
batteryOptimisationAsked = prefs.getBoolean(BATTERY_OPTIMISATION_ASKED,false)
|
||||
|
|
|
@ -295,7 +295,7 @@ class ShowLocationHelper(private val app: TelegramApplication) {
|
|||
|
||||
private fun getStatusWidgetIntent(): Intent {
|
||||
val startIntent = app.packageManager.getLaunchIntentForPackage(app.packageName)
|
||||
startIntent.addCategory(Intent.CATEGORY_LAUNCHER)
|
||||
startIntent!!.addCategory(Intent.CATEGORY_LAUNCHER)
|
||||
startIntent.putExtra(OPEN_MY_LOCATION_TAB_KEY,true)
|
||||
return startIntent
|
||||
}
|
||||
|
|
|
@ -106,18 +106,20 @@ class SetTimeBottomSheet : DialogFragment() {
|
|||
}
|
||||
|
||||
private fun selectStartDate() {
|
||||
val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
|
||||
startCalendar.set(Calendar.YEAR, year)
|
||||
startCalendar.set(Calendar.MONTH, monthOfYear)
|
||||
startCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
|
||||
updateDateAndTimeButtons()
|
||||
}
|
||||
DatePickerDialog(
|
||||
context, dateFromDialog,
|
||||
startCalendar.get(Calendar.YEAR),
|
||||
startCalendar.get(Calendar.MONTH),
|
||||
startCalendar.get(Calendar.DAY_OF_MONTH)
|
||||
).show()
|
||||
context?.let {
|
||||
val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
|
||||
startCalendar.set(Calendar.YEAR, year)
|
||||
startCalendar.set(Calendar.MONTH, monthOfYear)
|
||||
startCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
|
||||
updateDateAndTimeButtons()
|
||||
}
|
||||
DatePickerDialog(
|
||||
it, dateFromDialog,
|
||||
startCalendar.get(Calendar.YEAR),
|
||||
startCalendar.get(Calendar.MONTH),
|
||||
startCalendar.get(Calendar.DAY_OF_MONTH)
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun selectStartTime() {
|
||||
|
@ -132,18 +134,20 @@ class SetTimeBottomSheet : DialogFragment() {
|
|||
}
|
||||
|
||||
private fun selectEndDate() {
|
||||
val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
|
||||
endCalendar.set(Calendar.YEAR, year)
|
||||
endCalendar.set(Calendar.MONTH, monthOfYear)
|
||||
endCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
|
||||
updateDateAndTimeButtons()
|
||||
}
|
||||
DatePickerDialog(
|
||||
context, dateFromDialog,
|
||||
endCalendar.get(Calendar.YEAR),
|
||||
endCalendar.get(Calendar.MONTH),
|
||||
endCalendar.get(Calendar.DAY_OF_MONTH)
|
||||
).show()
|
||||
context?.let {
|
||||
val dateFromDialog = DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
|
||||
endCalendar.set(Calendar.YEAR, year)
|
||||
endCalendar.set(Calendar.MONTH, monthOfYear)
|
||||
endCalendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
|
||||
updateDateAndTimeButtons()
|
||||
}
|
||||
DatePickerDialog(
|
||||
it, dateFromDialog,
|
||||
endCalendar.get(Calendar.YEAR),
|
||||
endCalendar.get(Calendar.MONTH),
|
||||
endCalendar.get(Calendar.DAY_OF_MONTH)
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun selectEndTime() {
|
||||
|
|
|
@ -53,7 +53,7 @@ class TimelineTabFragment : Fragment() {
|
|||
inflater: LayoutInflater,
|
||||
container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
): View {
|
||||
mainView = inflater.inflate(R.layout.fragment_timeline_tab, container, false)
|
||||
val appBarLayout = mainView.findViewById<View>(R.id.app_bar_layout)
|
||||
|
||||
|
@ -139,22 +139,24 @@ class TimelineTabFragment : Fragment() {
|
|||
fun tabClosed() {}
|
||||
|
||||
private fun selectDate() {
|
||||
val dateSetListener =
|
||||
DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
|
||||
calendar = Calendar.getInstance()
|
||||
calendar.set(Calendar.YEAR, year)
|
||||
calendar.set(Calendar.MONTH, monthOfYear)
|
||||
calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
|
||||
context?.let {
|
||||
val dateSetListener =
|
||||
DatePickerDialog.OnDateSetListener { _, year, monthOfYear, dayOfMonth ->
|
||||
calendar = Calendar.getInstance()
|
||||
calendar.set(Calendar.YEAR, year)
|
||||
calendar.set(Calendar.MONTH, monthOfYear)
|
||||
calendar.set(Calendar.DAY_OF_MONTH, dayOfMonth)
|
||||
|
||||
updateList()
|
||||
updateDateButton()
|
||||
}
|
||||
DatePickerDialog(
|
||||
context, dateSetListener,
|
||||
calendar.get(Calendar.YEAR),
|
||||
calendar.get(Calendar.MONTH),
|
||||
calendar.get(Calendar.DAY_OF_MONTH)
|
||||
).show()
|
||||
updateList()
|
||||
updateDateButton()
|
||||
}
|
||||
DatePickerDialog(
|
||||
it, dateSetListener,
|
||||
calendar.get(Calendar.YEAR),
|
||||
calendar.get(Calendar.MONTH),
|
||||
calendar.get(Calendar.DAY_OF_MONTH)
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
private fun getStartOfDay(calendar: Calendar): Long {
|
||||
|
|
|
@ -32,11 +32,11 @@ class BottomSheetDialog(ctx: Context) : Dialog(ctx, R.style.AppTheme_BottomSheet
|
|||
super.setContentView(wrapInContainer(layoutResID, null, null))
|
||||
}
|
||||
|
||||
override fun setContentView(view: View?) {
|
||||
override fun setContentView(view: View) {
|
||||
super.setContentView(wrapInContainer(0, view, null))
|
||||
}
|
||||
|
||||
override fun setContentView(view: View?, params: ViewGroup.LayoutParams?) {
|
||||
override fun setContentView(view: View, params: ViewGroup.LayoutParams?) {
|
||||
super.setContentView(wrapInContainer(0, view, params))
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class TextViewEx : AppCompatTextView {
|
|||
}
|
||||
|
||||
val typefaceName = resolvedAttrs.getString(R.styleable.TextViewEx_typeface)
|
||||
val typeface = FontCache.getFont(context, typefaceName)
|
||||
val typeface = FontCache.getFont(context, typefaceName!!)
|
||||
if (typeface != null) {
|
||||
val style = getTypeface()?.style ?: 0
|
||||
setTypeface(typeface, style)
|
||||
|
|
Loading…
Reference in a new issue