adding a folder picker to the widget config screen

This commit is contained in:
tibbi 2018-12-16 16:24:44 +01:00
parent bd22244a85
commit 233b6e3b54
34 changed files with 124 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import android.app.Activity
import android.appwidget.AppWidgetManager import android.appwidget.AppWidgetManager
import android.content.Intent import android.content.Intent
import android.graphics.Color import android.graphics.Color
import android.graphics.drawable.ColorDrawable
import android.os.Bundle import android.os.Bundle
import android.widget.RemoteViews import android.widget.RemoteViews
import com.simplemobiletools.commons.dialogs.ColorPickerDialog import com.simplemobiletools.commons.dialogs.ColorPickerDialog
@ -37,6 +38,8 @@ class WidgetConfigureActivity : SimpleActivity() {
config_save.setOnClickListener { saveConfig() } config_save.setOnClickListener { saveConfig() }
config_bg_color.setOnClickListener { pickBackgroundColor() } config_bg_color.setOnClickListener { pickBackgroundColor() }
config_save.setTextColor(getAdjustedPrimaryColor()) config_save.setTextColor(getAdjustedPrimaryColor())
updateTextColors(folder_picker_holder)
folder_picker_holder.background = ColorDrawable(config.backgroundColor)
} }
private fun initVariables() { private fun initVariables() {

View file

@ -7,10 +7,35 @@
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_margin="@dimen/activity_margin"> android:layout_margin="@dimen/activity_margin">
<RelativeLayout
android:id="@+id/folder_picker_holder"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/activity_margin">
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/folder_picker_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/normal_margin"
android:text="@string/folder_on_widget"/>
<com.simplemobiletools.commons.views.MyTextView
android:id="@+id/folder_picker_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/folder_picker_label"
android:background="@drawable/button_background"
android:padding="@dimen/normal_margin"
android:text="@string/internal"/>
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/config_image_holder" android:id="@+id/config_image_holder"
android:layout_width="110dp" android:layout_width="110dp"
android:layout_height="110dp" android:layout_height="110dp"
android:layout_below="@+id/folder_picker_holder"
android:padding="@dimen/activity_margin"> android:padding="@dimen/activity_margin">
<ImageView <ImageView

View file

@ -136,6 +136,9 @@
<string name="by_file_type">File type</string> <string name="by_file_type">File type</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">تشغيل الفديوهات تلقائيا</string> <string name="autoplay_videos">تشغيل الفديوهات تلقائيا</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">File type</string> <string name="by_file_type">File type</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Play videos automatically</string> <string name="autoplay_videos">Play videos automatically</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Tipus de fitxer</string> <string name="by_file_type">Tipus de fitxer</string>
<string name="by_extension">Extensió</string> <string name="by_extension">Extensió</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Reproduir vídeos automàticament</string> <string name="autoplay_videos">Reproduir vídeos automàticament</string>
<string name="remember_last_video_position">Recordeu la posició de la darrera reproducció de vídeo</string> <string name="remember_last_video_position">Recordeu la posició de la darrera reproducció de vídeo</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Typu souboru</string> <string name="by_file_type">Typu souboru</string>
<string name="by_extension">Přípony</string> <string name="by_extension">Přípony</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Automaticky přehrávat videa</string> <string name="autoplay_videos">Automaticky přehrávat videa</string>
<string name="remember_last_video_position">Zapamatovat pozici posledního přehraného videa</string> <string name="remember_last_video_position">Zapamatovat pozici posledního přehraného videa</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">File type</string> <string name="by_file_type">File type</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Afspil automatisk videoer</string> <string name="autoplay_videos">Afspil automatisk videoer</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Dateityp (Bilder/Videos)</string> <string name="by_file_type">Dateityp (Bilder/Videos)</string>
<string name="by_extension">Dateierweiterung</string> <string name="by_extension">Dateierweiterung</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Videos automatisch abspielen</string> <string name="autoplay_videos">Videos automatisch abspielen</string>
<string name="remember_last_video_position">Letzte Videowiedergabeposition erinnern</string> <string name="remember_last_video_position">Letzte Videowiedergabeposition erinnern</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Τύπο αρχείου</string> <string name="by_file_type">Τύπο αρχείου</string>
<string name="by_extension">Επέκταση</string> <string name="by_extension">Επέκταση</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Αυτόματη αναπαραγωγή βίντεο</string> <string name="autoplay_videos">Αυτόματη αναπαραγωγή βίντεο</string>
<string name="remember_last_video_position">Απομνημόνευση της τελευταίας θέσης αναπαραγωγής βίντεο</string> <string name="remember_last_video_position">Απομνημόνευση της τελευταίας θέσης αναπαραγωγής βίντεο</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Tipo de fichero</string> <string name="by_file_type">Tipo de fichero</string>
<string name="by_extension">Extensión</string> <string name="by_extension">Extensión</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Reproducir vídeos automáticamente</string> <string name="autoplay_videos">Reproducir vídeos automáticamente</string>
<string name="remember_last_video_position">Recuerde la última posición de reproducción de video</string> <string name="remember_last_video_position">Recuerde la última posición de reproducción de video</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">File type</string> <string name="by_file_type">File type</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Toista videot automaattisesti</string> <string name="autoplay_videos">Toista videot automaattisesti</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Type de fichier</string> <string name="by_file_type">Type de fichier</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Lecture automatique des vidéos</string> <string name="autoplay_videos">Lecture automatique des vidéos</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Tipo de ficheior</string> <string name="by_file_type">Tipo de ficheior</string>
<string name="by_extension">Extensión</string> <string name="by_extension">Extensión</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Reproducir vídeos automticamente</string> <string name="autoplay_videos">Reproducir vídeos automticamente</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Tip datoteke</string> <string name="by_file_type">Tip datoteke</string>
<string name="by_extension">Vrsta datoteke</string> <string name="by_extension">Vrsta datoteke</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Automatsko pokretanje videa</string> <string name="autoplay_videos">Automatsko pokretanje videa</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -133,6 +133,9 @@
<string name="by_file_type">Fájl típus</string> <string name="by_file_type">Fájl típus</string>
<string name="by_extension">Kiterjesztés</string> <string name="by_extension">Kiterjesztés</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Automatikus videó lejátszás</string> <string name="autoplay_videos">Automatikus videó lejátszás</string>
<string name="remember_last_video_position">Emlékezzen a videó utolsó lejátszási pozícióra</string> <string name="remember_last_video_position">Emlékezzen a videó utolsó lejátszási pozícióra</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Jenis file</string> <string name="by_file_type">Jenis file</string>
<string name="by_extension">Ekstensi</string> <string name="by_extension">Ekstensi</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Putar video otomatis</string> <string name="autoplay_videos">Putar video otomatis</string>
<string name="remember_last_video_position">Ingat posisi pemutaran terakhir</string> <string name="remember_last_video_position">Ingat posisi pemutaran terakhir</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Tipo di file</string> <string name="by_file_type">Tipo di file</string>
<string name="by_extension">Estensione</string> <string name="by_extension">Estensione</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Riproduci i video automaticamente</string> <string name="autoplay_videos">Riproduci i video automaticamente</string>
<string name="remember_last_video_position">Ricorda l\'ultimo stato di riproduzione dei video</string> <string name="remember_last_video_position">Ricorda l\'ultimo stato di riproduzione dei video</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">ファイル形式</string> <string name="by_file_type">ファイル形式</string>
<string name="by_extension">拡張子</string> <string name="by_extension">拡張子</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">ビデオを自動再生</string> <string name="autoplay_videos">ビデオを自動再生</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">File type</string> <string name="by_file_type">File type</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">비디오 자동재생</string> <string name="autoplay_videos">비디오 자동재생</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">File type</string> <string name="by_file_type">File type</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Groti vaizdo įrašus automatiškai</string> <string name="autoplay_videos">Groti vaizdo įrašus automatiškai</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Filtype</string> <string name="by_file_type">Filtype</string>
<string name="by_extension">Endelse</string> <string name="by_extension">Endelse</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Avspill videoer automatisk</string> <string name="autoplay_videos">Avspill videoer automatisk</string>
<string name="remember_last_video_position">Husk siste videoavspillingsposisjon</string> <string name="remember_last_video_position">Husk siste videoavspillingsposisjon</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Bestandstype</string> <string name="by_file_type">Bestandstype</string>
<string name="by_extension">Extensie</string> <string name="by_extension">Extensie</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Video\'s automatisch afspelen</string> <string name="autoplay_videos">Video\'s automatisch afspelen</string>
<string name="remember_last_video_position">Laatste positie in video\'s onthouden</string> <string name="remember_last_video_position">Laatste positie in video\'s onthouden</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Typu</string> <string name="by_file_type">Typu</string>
<string name="by_extension">Rozszerzenia</string> <string name="by_extension">Rozszerzenia</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Odtwarzaj filmy automatycznie</string> <string name="autoplay_videos">Odtwarzaj filmy automatycznie</string>
<string name="remember_last_video_position">Pamiętaj ostatni moment odtwarzania filmów</string> <string name="remember_last_video_position">Pamiętaj ostatni moment odtwarzania filmów</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">File type</string> <string name="by_file_type">File type</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Reproduzir vídeos automaticamente</string> <string name="autoplay_videos">Reproduzir vídeos automaticamente</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Tipo de ficheiro</string> <string name="by_file_type">Tipo de ficheiro</string>
<string name="by_extension">Extensão</string> <string name="by_extension">Extensão</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Reproduzir vídeos automaticamente</string> <string name="autoplay_videos">Reproduzir vídeos automaticamente</string>
<string name="remember_last_video_position">Memorizar posição da reprodução</string> <string name="remember_last_video_position">Memorizar posição da reprodução</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Тип файла</string> <string name="by_file_type">Тип файла</string>
<string name="by_extension">Расширение</string> <string name="by_extension">Расширение</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Воспроизводить видео автоматически</string> <string name="autoplay_videos">Воспроизводить видео автоматически</string>
<string name="remember_last_video_position">Запоминать позицию воспроизведения видео</string> <string name="remember_last_video_position">Запоминать позицию воспроизведения видео</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Typu súboru</string> <string name="by_file_type">Typu súboru</string>
<string name="by_extension">Prípony</string> <string name="by_extension">Prípony</string>
<!-- Widgets -->
<string name="folder_on_widget">Priečinok zobrazený vo widgete:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Spúšťať videá automaticky</string> <string name="autoplay_videos">Spúšťať videá automaticky</string>
<string name="remember_last_video_position">Zapamätať si pozíciu posledného prehraného videa</string> <string name="remember_last_video_position">Zapamätať si pozíciu posledného prehraného videa</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Tip datoteke</string> <string name="by_file_type">Tip datoteke</string>
<string name="by_extension">Končnica</string> <string name="by_extension">Končnica</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Avtomatično predvajaj videoposnetke</string> <string name="autoplay_videos">Avtomatično predvajaj videoposnetke</string>
<string name="remember_last_video_position">Zapomni si zadnji položaj predvajanja</string> <string name="remember_last_video_position">Zapomni si zadnji položaj predvajanja</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Filtyp</string> <string name="by_file_type">Filtyp</string>
<string name="by_extension">Filnamnstillägg</string> <string name="by_extension">Filnamnstillägg</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Spela upp videor automatiskt</string> <string name="autoplay_videos">Spela upp videor automatiskt</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">Dosya türü</string> <string name="by_file_type">Dosya türü</string>
<string name="by_extension">Uzantı</string> <string name="by_extension">Uzantı</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Videoları otomatik oynat</string> <string name="autoplay_videos">Videoları otomatik oynat</string>
<string name="remember_last_video_position">Son video oynatma konumunu hatırla</string> <string name="remember_last_video_position">Son video oynatma konumunu hatırla</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">типом файлу</string> <string name="by_file_type">типом файлу</string>
<string name="by_extension">розширенням</string> <string name="by_extension">розширенням</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Відтворювати відео автоматично</string> <string name="autoplay_videos">Відтворювати відео автоматично</string>
<string name="remember_last_video_position">Запам\'ятовувати місце зупинки перегляду</string> <string name="remember_last_video_position">Запам\'ятовувати місце зупинки перегляду</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">文件类型</string> <string name="by_file_type">文件类型</string>
<string name="by_extension">扩展</string> <string name="by_extension">扩展</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">自动播放</string> <string name="autoplay_videos">自动播放</string>
<string name="remember_last_video_position">记住上次视频播放位置</string> <string name="remember_last_video_position">记住上次视频播放位置</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">檔案類型</string> <string name="by_file_type">檔案類型</string>
<string name="by_extension">副檔名</string> <string name="by_extension">副檔名</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">自動播放影片</string> <string name="autoplay_videos">自動播放影片</string>
<string name="remember_last_video_position">記住影片上次撥放位置</string> <string name="remember_last_video_position">記住影片上次撥放位置</string>

View file

@ -132,6 +132,9 @@
<string name="by_file_type">File type</string> <string name="by_file_type">File type</string>
<string name="by_extension">Extension</string> <string name="by_extension">Extension</string>
<!-- Widgets -->
<string name="folder_on_widget">Folder shown on the widget:</string>
<!-- Settings --> <!-- Settings -->
<string name="autoplay_videos">Play videos automatically</string> <string name="autoplay_videos">Play videos automatically</string>
<string name="remember_last_video_position">Remember last video playback position</string> <string name="remember_last_video_position">Remember last video playback position</string>