updating Commons + many other things

This commit is contained in:
tibbi 2019-01-24 21:47:36 +01:00
parent e30f145bb3
commit 921873f9a6
40 changed files with 203 additions and 266 deletions

View File

@ -4,11 +4,11 @@ apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
buildToolsVersion "28.0.2"
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.simplemobiletools.clock"
minSdkVersion 16
minSdkVersion 21
targetSdkVersion 28
versionCode 10
versionName "4.3.0"
@ -41,9 +41,9 @@ android {
}
dependencies {
implementation 'com.simplemobiletools:commons:4.7.10'
implementation 'com.simplemobiletools:commons:5.6.16'
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'com.shawnlin:number-picker:2.4.6'
}

View File

@ -1,9 +1,7 @@
package com.simplemobiletools.clock.activities
import android.annotation.TargetApi
import android.content.Intent
import android.graphics.drawable.ColorDrawable
import android.os.Build
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
@ -18,6 +16,7 @@ import com.simplemobiletools.clock.extensions.rescheduleEnabledAlarms
import com.simplemobiletools.clock.helpers.*
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.LICENSE_NUMBER_PICKER
import com.simplemobiletools.commons.helpers.LICENSE_RTL
import com.simplemobiletools.commons.helpers.LICENSE_STETHO
import com.simplemobiletools.commons.models.FAQItem
import kotlinx.android.synthetic.main.activity_main.*
@ -118,7 +117,6 @@ class MainActivity : SimpleActivity() {
}
}
@TargetApi(Build.VERSION_CODES.KITKAT)
private fun storeNewAlarmSound(resultData: Intent) {
val newAlarmSound = storeNewYourAlarmSound(resultData)
@ -179,7 +177,7 @@ class MainActivity : SimpleActivity() {
}
private fun launchAbout() {
val licenses = LICENSE_STETHO or LICENSE_NUMBER_PICKER
val licenses = LICENSE_STETHO or LICENSE_NUMBER_PICKER or LICENSE_RTL
val faqItems = arrayListOf(
FAQItem(R.string.faq_1_title, R.string.faq_1_text),

View File

@ -7,6 +7,7 @@ import android.net.Uri
import android.os.Bundle
import android.os.Handler
import android.view.MotionEvent
import android.view.ViewGroup
import android.view.animation.AnimationUtils
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.extensions.*
@ -34,7 +35,7 @@ class ReminderActivity : SimpleActivity() {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_reminder)
showOverLockscreen()
updateTextColors(reminder_holder)
updateTextColors(reminder_holder as ViewGroup)
val id = intent.getIntExtra(ALARM_ID, -1)
isAlarmReminder = id != -1

View File

@ -25,7 +25,6 @@ class SettingsActivity : SimpleActivity() {
setupPurchaseThankYou()
setupCustomizeColors()
setupUseEnglish()
setupAvoidWhatsNew()
setupPreventPhoneFromSleeping()
setupHourFormat()
setupSundayFirst()
@ -72,14 +71,6 @@ class SettingsActivity : SimpleActivity() {
}
}
private fun setupAvoidWhatsNew() {
settings_avoid_whats_new.isChecked = config.avoidWhatsNew
settings_avoid_whats_new_holder.setOnClickListener {
settings_avoid_whats_new.toggle()
config.avoidWhatsNew = settings_avoid_whats_new.isChecked
}
}
private fun setupPreventPhoneFromSleeping() {
settings_prevent_phone_from_sleeping.isChecked = config.preventPhoneFromSleeping
settings_prevent_phone_from_sleeping_holder.setOnClickListener {

View File

@ -1,7 +1,7 @@
package com.simplemobiletools.clock.activities
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import androidx.appcompat.app.AppCompatActivity
import com.simplemobiletools.clock.extensions.config
import com.simplemobiletools.clock.extensions.dbHelper
import com.simplemobiletools.clock.extensions.hideNotification

View File

@ -7,6 +7,8 @@ import com.simplemobiletools.clock.helpers.TAB_CLOCK
import com.simplemobiletools.commons.activities.BaseSplashActivity
class SplashActivity : BaseSplashActivity() {
override fun getAppPackageName() = packageName
override fun initActivity() {
when {
intent?.action == "android.intent.action.SHOW_ALARMS" -> {

View File

@ -7,7 +7,6 @@ import android.widget.RelativeLayout
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity
import com.simplemobiletools.clock.extensions.config
import com.simplemobiletools.clock.extensions.dbHelper
import com.simplemobiletools.clock.extensions.getFormattedTime
import com.simplemobiletools.clock.interfaces.ToggleAlarmInterface
import com.simplemobiletools.clock.models.Alarm
@ -30,14 +29,8 @@ class AlarmsAdapter(activity: SimpleActivity, var alarms: ArrayList<Alarm>, val
override fun prepareActionMode(menu: Menu) {}
override fun prepareItemSelection(viewHolder: ViewHolder) {}
override fun markViewHolderSelection(select: Boolean, viewHolder: ViewHolder?) {
viewHolder?.itemView?.alarm_frame?.isSelected = select
}
override fun actionItemPressed(id: Int) {
if (selectedPositions.isEmpty()) {
if (selectedKeys.isEmpty()) {
return
}
@ -50,14 +43,18 @@ class AlarmsAdapter(activity: SimpleActivity, var alarms: ArrayList<Alarm>, val
override fun getIsItemSelectable(position: Int) = true
override fun getItemSelectionKey(position: Int) = alarms.getOrNull(position)?.id
override fun getItemKeyPosition(key: Int) = alarms.indexOfFirst { it.id == key }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_alarm, parent)
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
val alarm = alarms[position]
val view = holder.bindView(alarm, true, true) { itemView, layoutPosition ->
holder.bindView(alarm, true, true) { itemView, layoutPosition ->
setupView(itemView, alarm)
}
bindViewHolder(holder, position, view)
bindViewHolder(holder)
}
override fun getItemCount() = alarms.size
@ -70,18 +67,20 @@ class AlarmsAdapter(activity: SimpleActivity, var alarms: ArrayList<Alarm>, val
private fun deleteItems() {
val alarmsToRemove = ArrayList<Alarm>()
selectedPositions.sortedDescending().forEach {
/*selectedPositions.sortedDescending().forEach {
val alarm = alarms[it]
alarmsToRemove.add(alarm)
}
alarms.removeAll(alarmsToRemove)
removeSelectedItems()
activity.dbHelper.deleteAlarms(alarmsToRemove)
activity.dbHelper.deleteAlarms(alarmsToRemove)*/
}
private fun setupView(view: View, alarm: Alarm) {
val isSelected = selectedKeys.contains(alarm.id)
view.apply {
alarm_frame.isSelected = isSelected
alarm_time.text = activity.getFormattedTime(alarm.timeInMinutes * 60, false, true)
alarm_time.setTextColor(textColor)

View File

@ -1,89 +1,75 @@
package com.simplemobiletools.clock.adapters
import android.support.v7.widget.RecyclerView
import android.util.SparseArray
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity
import com.simplemobiletools.clock.extensions.config
import com.simplemobiletools.clock.models.MyTimeZone
import com.simplemobiletools.commons.extensions.getAdjustedPrimaryColor
import com.simplemobiletools.commons.interfaces.MyAdapterListener
import kotlinx.android.synthetic.main.item_add_time_zone.view.*
import java.util.*
class SelectTimeZonesAdapter(val activity: SimpleActivity, val timeZones: ArrayList<MyTimeZone>) : RecyclerView.Adapter<SelectTimeZonesAdapter.ViewHolder>() {
private val itemViews = SparseArray<View>()
private val selectedPositions = HashSet<Int>()
private val config = activity.config
private val textColor = config.textColor
private val backgroundColor = config.backgroundColor
private val primaryColor = activity.getAdjustedPrimaryColor()
var selectedKeys = HashSet<Int>()
init {
val selectedTimeZones = config.selectedTimeZones
timeZones.forEachIndexed { index, myTimeZone ->
if (selectedTimeZones.contains(myTimeZone.id.toString())) {
selectedPositions.add(index)
selectedKeys.add(myTimeZone.id)
}
}
}
private fun toggleItemSelection(select: Boolean, pos: Int) {
val itemKey = timeZones.getOrNull(pos)?.id ?: return
if (select) {
if (itemViews[pos] != null) {
selectedPositions.add(pos)
}
selectedKeys.add(itemKey)
} else {
selectedPositions.remove(pos)
selectedKeys.remove(itemKey)
}
itemViews[pos]?.add_time_zone_checkbox?.isChecked = select
}
private val adapterListener = object : MyAdapterListener {
override fun toggleItemSelectionAdapter(select: Boolean, position: Int) {
toggleItemSelection(select, position)
}
override fun getSelectedPositions() = selectedPositions
override fun itemLongClicked(position: Int) {}
}
fun getSelectedItemsSet(): HashSet<String> {
val selectedItemsSet = HashSet<String>(selectedPositions.size)
selectedPositions.forEach { selectedItemsSet.add(timeZones[it].id.toString()) }
return selectedItemsSet
notifyItemChanged(pos)
}
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
val view = activity.layoutInflater.inflate(R.layout.item_add_time_zone, parent, false)
return ViewHolder(view, adapterListener)
return ViewHolder(view)
}
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
val timeZone = timeZones[position]
itemViews.put(position, holder.bindView(timeZone, textColor, primaryColor, backgroundColor))
toggleItemSelection(selectedPositions.contains(position), position)
holder.bindView(timeZones[position], textColor, primaryColor, backgroundColor)
}
override fun getItemCount() = timeZones.size
class ViewHolder(view: View, val adapterListener: MyAdapterListener) : RecyclerView.ViewHolder(view) {
fun bindView(timeZone: MyTimeZone, textColor: Int, primaryColor: Int, backgroundColor: Int): View {
inner class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
fun bindView(myTimeZone: MyTimeZone, textColor: Int, primaryColor: Int, backgroundColor: Int): View {
val isSelected = selectedKeys.contains(myTimeZone.id)
itemView.apply {
add_time_zone_title.text = timeZone.title
add_time_zone_checkbox.isChecked = isSelected
add_time_zone_title.text = myTimeZone.title
add_time_zone_title.setTextColor(textColor)
add_time_zone_checkbox.setColors(textColor, primaryColor, backgroundColor)
add_time_zone_holder.setOnClickListener {
adapterListener.toggleItemSelectionAdapter(!add_time_zone_checkbox.isChecked, adapterPosition)
viewClicked(myTimeZone)
}
}
return itemView
}
private fun viewClicked(myTimeZone: MyTimeZone) {
val isSelected = selectedKeys.contains(myTimeZone.id)
toggleItemSelection(!isSelected, adapterPosition)
}
}
}

View File

@ -26,24 +26,24 @@ class StopwatchAdapter(activity: SimpleActivity, var laps: ArrayList<Lap>, recyc
override fun prepareActionMode(menu: Menu) {}
override fun prepareItemSelection(viewHolder: ViewHolder) {}
override fun markViewHolderSelection(select: Boolean, viewHolder: ViewHolder?) {}
override fun actionItemPressed(id: Int) {}
override fun getSelectableItemCount() = laps.size
override fun getIsItemSelectable(position: Int) = false
override fun getItemSelectionKey(position: Int) = laps.getOrNull(position)?.id
override fun getItemKeyPosition(key: Int) = laps.indexOfFirst { it.id == key }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_lap, parent)
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
val lap = laps[position]
val view = holder.bindView(lap, false, false) { itemView, layoutPosition ->
holder.bindView(lap, false, false) { itemView, layoutPosition ->
setupView(itemView, lap)
}
bindViewHolder(holder, position, view)
bindViewHolder(holder)
}
override fun getItemCount() = laps.size

View File

@ -5,7 +5,6 @@ import android.view.View
import android.view.ViewGroup
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity
import com.simplemobiletools.clock.extensions.config
import com.simplemobiletools.clock.extensions.getFormattedDate
import com.simplemobiletools.clock.extensions.getFormattedTime
import com.simplemobiletools.clock.models.MyTimeZone
@ -29,14 +28,8 @@ class TimeZonesAdapter(activity: SimpleActivity, var timeZones: ArrayList<MyTime
override fun prepareActionMode(menu: Menu) {}
override fun prepareItemSelection(viewHolder: ViewHolder) {}
override fun markViewHolderSelection(select: Boolean, viewHolder: ViewHolder?) {
viewHolder?.itemView?.time_zone_frame?.isSelected = select
}
override fun actionItemPressed(id: Int) {
if (selectedPositions.isEmpty()) {
if (selectedKeys.isEmpty()) {
return
}
@ -49,14 +42,18 @@ class TimeZonesAdapter(activity: SimpleActivity, var timeZones: ArrayList<MyTime
override fun getIsItemSelectable(position: Int) = true
override fun getItemSelectionKey(position: Int) = timeZones.getOrNull(position)?.id
override fun getItemKeyPosition(key: Int) = timeZones.indexOfFirst { it.id == key }
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int) = createViewHolder(R.layout.item_time_zone, parent)
override fun onBindViewHolder(holder: MyRecyclerViewAdapter.ViewHolder, position: Int) {
val timeZone = timeZones[position]
val view = holder.bindView(timeZone, true, true) { itemView, layoutPosition ->
holder.bindView(timeZone, true, true) { itemView, layoutPosition ->
setupView(itemView, timeZone)
}
bindViewHolder(holder, position, view)
bindViewHolder(holder)
}
override fun getItemCount() = timeZones.size
@ -74,7 +71,7 @@ class TimeZonesAdapter(activity: SimpleActivity, var timeZones: ArrayList<MyTime
private fun deleteItems() {
val timeZonesToRemove = ArrayList<MyTimeZone>()
val timeZoneIDsToRemove = ArrayList<String>()
selectedPositions.sortedDescending().forEach {
/*selectedPositions.sortedDescending().forEach {
val timeZone = timeZones[it]
timeZonesToRemove.add(timeZone)
timeZoneIDsToRemove.add(timeZone.id.toString())
@ -85,7 +82,7 @@ class TimeZonesAdapter(activity: SimpleActivity, var timeZones: ArrayList<MyTime
val selectedTimeZones = activity.config.selectedTimeZones
val newTimeZones = selectedTimeZones.filter { !timeZoneIDsToRemove.contains(it) }.toHashSet()
activity.config.selectedTimeZones = newTimeZones
activity.config.selectedTimeZones = newTimeZones*/
}
private fun setupView(view: View, timeZone: MyTimeZone) {
@ -100,7 +97,9 @@ class TimeZonesAdapter(activity: SimpleActivity, var timeZones: ArrayList<MyTime
val formattedTime = activity.getFormattedTime(passedSeconds, false, false)
val formattedDate = activity.getFormattedDate(calendar)
val isSelected = selectedKeys.contains(timeZone.id)
view.apply {
time_zone_frame.isSelected = isSelected
time_zone_title.text = timeZone.title
time_zone_title.setTextColor(textColor)

View File

@ -1,9 +1,9 @@
package com.simplemobiletools.clock.adapters
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentStatePagerAdapter
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentStatePagerAdapter
import com.simplemobiletools.clock.fragments.AlarmFragment
import com.simplemobiletools.clock.fragments.ClockFragment
import com.simplemobiletools.clock.fragments.StopwatchFragment

View File

@ -1,6 +1,6 @@
package com.simplemobiletools.clock.dialogs
import android.support.v7.app.AlertDialog
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity
import com.simplemobiletools.clock.adapters.SelectTimeZonesAdapter
@ -16,7 +16,7 @@ class AddTimeZonesDialog(val activity: SimpleActivity, private val callback: ()
view.select_time_zones_list.adapter = SelectTimeZonesAdapter(activity, getAllTimeZones())
AlertDialog.Builder(activity)
.setPositiveButton(R.string.ok, { dialog, which -> dialogConfirmed() })
.setPositiveButton(R.string.ok) { dialog, which -> dialogConfirmed() }
.setNegativeButton(R.string.cancel, null)
.create().apply {
activity.setupDialogStuff(view, this)
@ -24,7 +24,8 @@ class AddTimeZonesDialog(val activity: SimpleActivity, private val callback: ()
}
private fun dialogConfirmed() {
val selectedTimeZones = (view?.select_time_zones_list?.adapter as? SelectTimeZonesAdapter)?.getSelectedItemsSet() ?: LinkedHashSet()
val adapter = view?.select_time_zones_list?.adapter as? SelectTimeZonesAdapter
val selectedTimeZones = adapter?.selectedKeys?.map { it.toString() }?.toHashSet() ?: LinkedHashSet()
activity.config.selectedTimeZones = selectedTimeZones
callback()
}

View File

@ -3,7 +3,7 @@ package com.simplemobiletools.clock.dialogs
import android.app.TimePickerDialog
import android.graphics.drawable.Drawable
import android.media.AudioManager
import android.support.v7.app.AlertDialog
import androidx.appcompat.app.AlertDialog
import android.widget.TextView
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity

View File

@ -1,6 +1,6 @@
package com.simplemobiletools.clock.dialogs
import android.support.v7.app.AlertDialog
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity
import com.simplemobiletools.clock.extensions.config

View File

@ -1,6 +1,6 @@
package com.simplemobiletools.clock.dialogs
import android.support.v7.app.AlertDialog
import androidx.appcompat.app.AlertDialog
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.SimpleActivity
import com.simplemobiletools.clock.extensions.config

View File

@ -1,7 +1,6 @@
package com.simplemobiletools.clock.extensions
import android.annotation.SuppressLint
import android.annotation.TargetApi
import android.app.*
import android.appwidget.AppWidgetManager
import android.content.ComponentName
@ -10,14 +9,12 @@ import android.content.Intent
import android.media.AudioAttributes
import android.media.AudioManager
import android.net.Uri
import android.os.Build
import android.os.PowerManager
import android.provider.Settings
import android.support.v4.app.AlarmManagerCompat
import android.support.v4.app.NotificationCompat
import android.text.SpannableString
import android.text.style.RelativeSizeSpan
import android.widget.Toast
import androidx.core.app.AlarmManagerCompat
import androidx.core.app.NotificationCompat
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.ReminderActivity
import com.simplemobiletools.clock.activities.SnoozeReminderActivity
@ -31,7 +28,10 @@ import com.simplemobiletools.clock.receivers.HideAlarmReceiver
import com.simplemobiletools.clock.receivers.HideTimerReceiver
import com.simplemobiletools.clock.services.SnoozeService
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.*
import com.simplemobiletools.commons.helpers.ALARM_SOUND_TYPE_ALARM
import com.simplemobiletools.commons.helpers.DAY_MINUTES
import com.simplemobiletools.commons.helpers.SILENT
import com.simplemobiletools.commons.helpers.isOreoPlus
import java.util.*
import kotlin.math.pow
@ -165,10 +165,7 @@ fun Context.scheduleNextWidgetUpdate() {
val alarmManager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
val triggerAtMillis = System.currentTimeMillis() + getMSTillNextMinute()
when {
isKitkatPlus() -> alarmManager.setExact(AlarmManager.RTC, triggerAtMillis, pendingIntent)
else -> alarmManager.set(AlarmManager.RTC, triggerAtMillis, pendingIntent)
}
alarmManager.setExact(AlarmManager.RTC, triggerAtMillis, pendingIntent)
}
fun Context.getFormattedTime(passedSeconds: Int, showSeconds: Boolean, makeAmPmSmaller: Boolean): SpannableString {
@ -195,25 +192,20 @@ fun Context.formatTo12HourFormat(showSeconds: Boolean, hours: Int, minutes: Int,
return "${formatTime(showSeconds, false, newHours, minutes, seconds)} $appendable"
}
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
fun Context.getNextAlarm(): String {
if (isLollipopPlus()) {
val milliseconds = (getSystemService(Context.ALARM_SERVICE) as AlarmManager).nextAlarmClock?.triggerTime ?: return ""
val calendar = Calendar.getInstance()
val isDaylightSavingActive = TimeZone.getDefault().inDaylightTime(Date())
var offset = calendar.timeZone.rawOffset
if (isDaylightSavingActive) {
offset += TimeZone.getDefault().dstSavings
}
calendar.timeInMillis = milliseconds
val dayOfWeekIndex = (calendar.get(Calendar.DAY_OF_WEEK) + 5) % 7
val dayOfWeek = resources.getStringArray(R.array.week_days_short)[dayOfWeekIndex]
val formatted = getFormattedTime(((milliseconds + offset) / 1000L).toInt(), false, false)
return "$dayOfWeek $formatted"
} else {
return Settings.System.getString(contentResolver, Settings.System.NEXT_ALARM_FORMATTED) ?: ""
val milliseconds = (getSystemService(Context.ALARM_SERVICE) as AlarmManager).nextAlarmClock?.triggerTime ?: return ""
val calendar = Calendar.getInstance()
val isDaylightSavingActive = TimeZone.getDefault().inDaylightTime(Date())
var offset = calendar.timeZone.rawOffset
if (isDaylightSavingActive) {
offset += TimeZone.getDefault().dstSavings
}
calendar.timeInMillis = milliseconds
val dayOfWeekIndex = (calendar.get(Calendar.DAY_OF_WEEK) + 5) % 7
val dayOfWeek = resources.getStringArray(R.array.week_days_short)[dayOfWeekIndex]
val formatted = getFormattedTime(((milliseconds + offset) / 1000L).toInt(), false, false)
return "$dayOfWeek $formatted"
}
fun Context.rescheduleEnabledAlarms() {
@ -287,9 +279,7 @@ fun Context.getTimerNotification(pendingIntent: PendingIntent, addDeleteIntent:
builder.setDeleteIntent(reminderActivityIntent)
}
if (isLollipopPlus()) {
builder.setVisibility(Notification.VISIBILITY_PUBLIC)
}
builder.setVisibility(Notification.VISIBILITY_PUBLIC)
if (config.timerVibrate) {
val vibrateArray = LongArray(2) { 500 }
@ -356,9 +346,7 @@ fun Context.getAlarmNotification(pendingIntent: PendingIntent, alarm: Alarm): No
.addAction(R.drawable.ic_snooze, getString(R.string.snooze), getSnoozePendingIntent(alarm))
.addAction(R.drawable.ic_cross, getString(R.string.dismiss), getHideAlarmPendingIntent(alarm))
if (isLollipopPlus()) {
builder.setVisibility(Notification.VISIBILITY_PUBLIC)
}
builder.setVisibility(Notification.VISIBILITY_PUBLIC)
if (alarm.vibrate) {
val vibrateArray = LongArray(2) { 500 }

View File

@ -1,7 +1,7 @@
package com.simplemobiletools.clock.fragments
import android.os.Bundle
import android.support.v4.app.Fragment
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

View File

@ -2,7 +2,7 @@ package com.simplemobiletools.clock.fragments
import android.os.Bundle
import android.os.Handler
import android.support.v4.app.Fragment
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup

View File

@ -6,10 +6,10 @@ import android.graphics.Matrix
import android.os.Bundle
import android.os.Handler
import android.os.SystemClock
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.simplemobiletools.clock.R

View File

@ -12,11 +12,11 @@ import android.os.Build
import android.os.Bundle
import android.os.Handler
import android.os.SystemClock
import android.support.v4.app.Fragment
import android.support.v4.app.NotificationCompat
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.core.app.NotificationCompat
import androidx.fragment.app.Fragment
import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.activities.ReminderActivity
import com.simplemobiletools.clock.activities.SimpleActivity
@ -27,7 +27,6 @@ import com.simplemobiletools.clock.helpers.TIMER_NOTIF_ID
import com.simplemobiletools.commons.dialogs.SelectAlarmSoundDialog
import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.ALARM_SOUND_TYPE_ALARM
import com.simplemobiletools.commons.helpers.isLollipopPlus
import com.simplemobiletools.commons.helpers.isOreoPlus
import com.simplemobiletools.commons.models.AlarmSound
import kotlinx.android.synthetic.main.fragment_timer.view.*
@ -271,10 +270,7 @@ class TimerFragment : Fragment() {
.setAutoCancel(true)
.setChannelId(channelId)
if (isLollipopPlus()) {
builder.setVisibility(Notification.VISIBILITY_PUBLIC)
}
builder.setVisibility(Notification.VISIBILITY_PUBLIC)
notificationManager.notify(TIMER_NOTIF_ID, builder.build())
}

View File

@ -6,7 +6,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.TabLayout
<com.google.android.material.tabs.TabLayout
android:id="@+id/main_tabs_holder"
android:layout_width="match_parent"
android:layout_height="48dp"
@ -16,32 +16,32 @@
app:tabMinWidth="150dp"
app:tabSelectedTextColor="@android:color/white">
<android.support.design.widget.TabItem
<com.google.android.material.tabs.TabItem
android:id="@+id/tab_clock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_clock"/>
<android.support.design.widget.TabItem
<com.google.android.material.tabs.TabItem
android:id="@+id/tab_alarm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_alarm"/>
<android.support.design.widget.TabItem
<com.google.android.material.tabs.TabItem
android:id="@+id/tab_stopwatch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_stopwatch"/>
<android.support.design.widget.TabItem
<com.google.android.material.tabs.TabItem
android:id="@+id/tab_timer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:icon="@drawable/ic_timer"/>
</android.support.design.widget.TabLayout>
</com.google.android.material.tabs.TabLayout>
<com.booking.rtlviewpager.RtlViewPager
<com.duolingo.open.rtlviewpager.RtlViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
@ -106,4 +106,4 @@
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"/>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -18,18 +18,18 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_purchase_thank_you"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/purchase_simple_thank_you"/>
</RelativeLayout>
@ -40,18 +40,18 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_colors"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/customize_colors"/>
</RelativeLayout>
@ -62,10 +62,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_use_english"
@ -73,47 +73,23 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/use_english_language"
app:switchPadding="@dimen/medium_margin"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_avoid_whats_new_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_avoid_whats_new"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:text="@string/avoid_whats_new"
app:switchPadding="@dimen/medium_margin"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/settings_prevent_phone_from_sleeping_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_prevent_phone_from_sleeping"
@ -121,8 +97,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/prevent_phone_from_sleeping"
app:switchPadding="@dimen/medium_margin"/>
@ -134,10 +110,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_hour_format"
@ -145,8 +121,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/use_24_hour_time_format"
app:switchPadding="@dimen/medium_margin"/>
@ -158,10 +134,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_sunday_first"
@ -169,8 +145,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/sunday_first"
app:switchPadding="@dimen/medium_margin"/>
@ -187,8 +163,8 @@
android:id="@+id/clock_tab_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginStart="@dimen/bigger_margin"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginTop="@dimen/activity_margin"
android:text="@string/clock_tab"
android:textAllCaps="true"
@ -200,10 +176,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_show_seconds"
@ -211,8 +187,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/show_seconds"
app:switchPadding="@dimen/medium_margin"/>
@ -229,8 +205,8 @@
android:id="@+id/alarm_tab_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginStart="@dimen/bigger_margin"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginTop="@dimen/activity_margin"
android:text="@string/alarm_tab"
android:textAllCaps="true"
@ -242,18 +218,18 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/bigger_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/bigger_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/bigger_margin">
android:paddingBottom="@dimen/bigger_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_alarm_max_reminder_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/settings_alarm_max_reminder"
android:layout_toStartOf="@+id/settings_alarm_max_reminder"
android:layout_toLeftOf="@+id/settings_alarm_max_reminder"
android:paddingLeft="@dimen/medium_margin"
android:paddingRight="@dimen/medium_margin"
android:text="@string/max_reminder_duration"/>
@ -277,10 +253,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_increase_volume_gradually"
@ -288,8 +264,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/increase_volume_gradually"
app:switchPadding="@dimen/medium_margin"/>
@ -301,10 +277,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_use_same_snooze"
@ -312,8 +288,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/use_same_snooze"
app:switchPadding="@dimen/medium_margin"/>
@ -325,18 +301,18 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/bigger_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/bigger_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/bigger_margin">
android:paddingBottom="@dimen/bigger_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_snooze_time_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/settings_snooze_time"
android:layout_toStartOf="@+id/settings_snooze_time"
android:layout_toLeftOf="@+id/settings_snooze_time"
android:paddingLeft="@dimen/medium_margin"
android:paddingRight="@dimen/medium_margin"
android:text="@string/snooze_time"/>
@ -365,8 +341,8 @@
android:id="@+id/stopwatch_tab_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginStart="@dimen/bigger_margin"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginTop="@dimen/activity_margin"
android:text="@string/stopwatch_tab"
android:textAllCaps="true"
@ -378,10 +354,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_vibrate"
@ -389,8 +365,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/vibrate_on_button_press"
app:switchPadding="@dimen/medium_margin"/>
</RelativeLayout>
@ -406,8 +382,8 @@
android:id="@+id/timer_tab_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginStart="@dimen/bigger_margin"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginTop="@dimen/activity_margin"
android:text="@string/timer_tab"
android:textAllCaps="true"
@ -419,18 +395,18 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/bigger_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/bigger_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/bigger_margin">
android:paddingBottom="@dimen/bigger_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_timer_max_reminder_label"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/settings_timer_max_reminder"
android:layout_toStartOf="@+id/settings_timer_max_reminder"
android:layout_toLeftOf="@+id/settings_timer_max_reminder"
android:paddingLeft="@dimen/medium_margin"
android:paddingRight="@dimen/medium_margin"
android:text="@string/max_reminder_duration"/>
@ -459,8 +435,8 @@
android:id="@+id/widgets_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginStart="@dimen/bigger_margin"
android:layout_marginLeft="@dimen/bigger_margin"
android:layout_marginTop="@dimen/activity_margin"
android:text="@string/widgets"
android:textAllCaps="true"
@ -472,10 +448,10 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/settings_use_text_shadow"
@ -483,8 +459,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/use_text_shadow"
app:switchPadding="@dimen/medium_margin"/>
</RelativeLayout>
@ -495,18 +471,18 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/medium_margin"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/activity_margin"
android:paddingLeft="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin"
android:paddingRight="@dimen/normal_margin"
android:paddingTop="@dimen/activity_margin">
android:paddingBottom="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/settings_customize_widget_colors_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="@dimen/medium_margin"
android:paddingStart="@dimen/medium_margin"
android:paddingLeft="@dimen/medium_margin"
android:text="@string/customize_widget_colors"/>
</RelativeLayout>

View File

@ -25,8 +25,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/alarm_day_size"
android:layout_below="@+id/edit_alarm_time"
android:layout_marginBottom="@dimen/medium_margin"
android:layout_marginTop="@dimen/medium_margin"
android:layout_marginBottom="@dimen/medium_margin"
android:orientation="horizontal"/>
<RelativeLayout
@ -35,9 +35,9 @@
android:layout_height="wrap_content"
android:layout_below="@+id/edit_alarm_days_holder"
android:background="?attr/selectableItemBackground"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/tiny_margin"
android:paddingTop="@dimen/normal_margin">
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin">
<com.simplemobiletools.commons.views.MySwitchCompat
android:id="@+id/edit_alarm_vibrate"
@ -59,9 +59,9 @@
android:background="?attr/selectableItemBackground"
android:drawableLeft="@drawable/ic_bell"
android:drawablePadding="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin"
android:paddingLeft="@dimen/tiny_margin"
android:paddingTop="@dimen/normal_margin"
android:paddingBottom="@dimen/normal_margin"
android:textSize="@dimen/normal_text_size"
tools:text="Default alarm"/>
@ -69,9 +69,9 @@
android:id="@+id/edit_alarm_label_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/edit_alarm_label"
android:layout_alignTop="@+id/edit_alarm_label"
android:layout_below="@+id/edit_alarm_sound"
android:layout_alignTop="@+id/edit_alarm_label"
android:layout_alignBottom="@+id/edit_alarm_label"
android:layout_marginLeft="@dimen/tiny_margin"
android:layout_marginRight="@dimen/tiny_margin"
android:scaleType="fitCenter"

View File

@ -18,8 +18,8 @@
android:id="@+id/edit_time_zone_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_margin"
android:layout_marginLeft="@dimen/small_margin"
android:layout_marginBottom="@dimen/activity_margin"
android:singleLine="true"
android:textCursorDrawable="@null"
android:textSize="@dimen/normal_text_size"/>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/alarm_fragment"
@ -30,4 +30,4 @@
android:layout_margin="@dimen/activity_margin"
android:src="@drawable/ic_plus"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
<androidx.coordinatorlayout.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
@ -65,4 +65,4 @@
android:layout_margin="@dimen/activity_margin"
android:src="@drawable/ic_plus"/>
</android.support.design.widget.CoordinatorLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
@ -21,7 +21,7 @@
app:layout_constraintTop_toTopOf="parent"
tools:text="00.00"/>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/stopwatch_sorting_indicators_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -55,7 +55,7 @@
app:layout_constraintStart_toEndOf="@+id/stopwatch_sorting_indicator_2"
app:layout_constraintTop_toTopOf="parent"/>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<com.simplemobiletools.commons.views.MyRecyclerView
android:id="@+id/stopwatch_list"
@ -73,11 +73,11 @@
<ImageView
android:id="@+id/stopwatch_reset"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="@dimen/stopwatch_button_small_size"
android:layout_height="@dimen/stopwatch_button_small_size"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/stopwatch_play_pause"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_reset"
android:visibility="gone"
@ -102,9 +102,9 @@
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/stopwatch_lap"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="wrap_content"
android:layout_height="@dimen/stopwatch_button_small_size"
android:background="?attr/selectableItemBackgroundBorderless"
android:gravity="center"
android:letterSpacing="0.1"
android:paddingLeft="@dimen/activity_margin"
@ -118,4 +118,4 @@
app:layout_constraintStart_toEndOf="@+id/stopwatch_play_pause"
app:layout_constraintTop_toTopOf="@+id/stopwatch_play_pause"/>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
@ -69,11 +69,11 @@
<ImageView
android:id="@+id/timer_reset"
style="@style/MyBorderlessBackgroundStyle"
android:layout_width="@dimen/stopwatch_button_small_size"
android:layout_height="@dimen/stopwatch_button_small_size"
android:layout_alignParentBottom="true"
android:layout_toLeftOf="@+id/timer_play_pause"
android:background="?attr/selectableItemBackgroundBorderless"
android:padding="@dimen/normal_margin"
android:src="@drawable/ic_reset"
android:visibility="gone"
@ -96,4 +96,4 @@
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"/>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -25,9 +25,9 @@
android:id="@+id/add_time_zone_checkbox"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/add_time_zone_title"
android:layout_alignBottom="@+id/add_time_zone_title"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/add_time_zone_title"
android:layout_marginRight="@dimen/activity_margin"
android:clickable="false"
android:gravity="center"/>

View File

@ -14,9 +14,9 @@
android:id="@+id/alarm_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/medium_margin"
android:paddingLeft="@dimen/activity_margin"
android:paddingTop="@dimen/medium_margin">
android:paddingTop="@dimen/medium_margin"
android:paddingBottom="@dimen/medium_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/alarm_time"
@ -58,9 +58,9 @@
android:id="@+id/alarm_switch"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignTop="@+id/alarm_time"
android:layout_alignBottom="@id/alarm_label"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/alarm_time"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/medium_margin"/>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
@ -46,4 +46,4 @@
app:layout_constraintTop_toTopOf="parent"
tools:text="0.00"/>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@ -11,7 +11,7 @@
android:focusable="true"
android:foreground="@drawable/selector">
<android.support.constraint.ConstraintLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/time_zone_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content">
@ -58,5 +58,5 @@
app:layout_constraintTop_toBottomOf="@+id/time_zone_time"
tools:text="Mon, 1 January"/>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>

View File

@ -45,8 +45,8 @@
android:id="@+id/config_bg_seekbar_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignBottom="@+id/config_bg_color"
android:layout_alignTop="@+id/config_bg_color"
android:layout_alignBottom="@+id/config_bg_color"
android:layout_toRightOf="@+id/config_bg_color"
android:background="@android:color/white">
@ -69,8 +69,8 @@
android:id="@+id/config_save"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:fontFamily="sans-serif-light"
android:paddingLeft="@dimen/activity_margin"
android:paddingRight="@dimen/activity_margin"

View File

@ -52,7 +52,7 @@
android:layout_height="@dimen/widget_alarm_icon_size"
android:layout_alignBottom="@+id/widget_next_alarm"
android:layout_alignTop="@+id/widget_next_alarm"
android:src="@drawable/ic_clock"/>
android:src="@drawable/ic_alarm"/>
<TextView
android:id="@+id/widget_next_alarm"

View File

@ -6,9 +6,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/small_margin"
android:paddingLeft="@dimen/small_margin"
android:paddingRight="@dimen/small_margin">
android:paddingRight="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin">
<TextView
android:id="@+id/widget_time"
@ -40,9 +40,9 @@
android:id="@+id/widget_next_alarm_image"
android:layout_width="@dimen/widget_alarm_icon_size"
android:layout_height="@dimen/widget_alarm_icon_size"
android:layout_alignBottom="@+id/widget_next_alarm"
android:layout_alignTop="@+id/widget_next_alarm"
android:src="@drawable/ic_clock"/>
android:layout_alignBottom="@+id/widget_next_alarm"
android:src="@drawable/ic_alarm"/>
<TextView
android:id="@+id/widget_next_alarm"

View File

@ -6,9 +6,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/small_margin"
android:paddingLeft="@dimen/small_margin"
android:paddingRight="@dimen/small_margin">
android:paddingRight="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin">
<TextView
android:id="@+id/widget_time"
@ -56,9 +56,9 @@
android:id="@+id/widget_next_alarm_image"
android:layout_width="@dimen/widget_alarm_icon_size"
android:layout_height="@dimen/widget_alarm_icon_size"
android:layout_alignBottom="@+id/widget_next_alarm"
android:layout_alignTop="@+id/widget_next_alarm"
android:src="@drawable/ic_clock"/>
android:layout_alignBottom="@+id/widget_next_alarm"
android:src="@drawable/ic_alarm"/>
<TextView
android:id="@+id/widget_next_alarm"

View File

@ -6,9 +6,9 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/small_margin"
android:paddingLeft="@dimen/small_margin"
android:paddingRight="@dimen/small_margin">
android:paddingRight="@dimen/small_margin"
android:paddingBottom="@dimen/small_margin">
<TextView
android:id="@+id/widget_time"
@ -46,9 +46,9 @@
android:id="@+id/widget_next_alarm_image"
android:layout_width="@dimen/widget_alarm_icon_size"
android:layout_height="@dimen/widget_alarm_icon_size"
android:layout_alignBottom="@+id/widget_next_alarm"
android:layout_alignTop="@+id/widget_next_alarm"
android:src="@drawable/ic_clock"/>
android:layout_alignBottom="@+id/widget_next_alarm"
android:src="@drawable/ic_alarm"/>
<TextView
android:id="@+id/widget_next_alarm"

View File

@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.70'
ext.kotlin_version = '1.3.11'
repositories {
google()
@ -9,7 +9,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong

View File

@ -1,6 +1,6 @@
#Tue Feb 27 23:34:43 CET 2018
#Thu Jan 24 21:07:22 CET 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip