├── app
├── .gitignore
├── src
│ └── main
│ │ ├── res
│ │ ├── font
│ │ │ ├── cabin.ttf
│ │ │ ├── rubik.ttf
│ │ │ ├── alegreya.ttf
│ │ │ ├── nunito.ttf
│ │ │ ├── pacifico.ttf
│ │ │ ├── quicksand.ttf
│ │ │ ├── ibmplexsans.ttf
│ │ │ ├── inconsolata.ttf
│ │ │ ├── merriweather.ttf
│ │ │ └── quattrocento.ttf
│ │ ├── drawable
│ │ │ ├── nobglogo.png
│ │ │ ├── circle.xml
│ │ │ ├── ic_circle.xml
│ │ │ ├── ic_check.xml
│ │ │ ├── settings_watch_face_preview_background.xml
│ │ │ ├── ic_capitalisationp.xml
│ │ │ ├── ic_infop.xml
│ │ │ ├── ic_complicationp.xml
│ │ │ ├── ic_miscp.xml
│ │ │ ├── ic_fontp.xml
│ │ │ ├── ic_datep.xml
│ │ │ ├── ic_showhidep.xml
│ │ │ ├── ic_colorp.xml
│ │ │ ├── ic_languagep.xml
│ │ │ └── custom_complication_styles.xml
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── drawable-hdpi
│ │ │ ├── add_complication.png
│ │ │ └── added_complication.png
│ │ ├── drawable-nodpi
│ │ │ ├── preview_digital.png
│ │ │ └── preview_digital_circular.png
│ │ ├── xml
│ │ │ └── watch_face.xml
│ │ ├── values
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── colors.xml
│ │ │ ├── dimens.xml
│ │ │ └── styles.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ └── layout
│ │ │ ├── wearablerecyclerview_activity.xml
│ │ │ ├── textview_item.xml
│ │ │ ├── imageview_and_textview_item.xml
│ │ │ ├── switch_and_textview_item.xml
│ │ │ ├── font_size_info_activity.xml
│ │ │ ├── about_screen.xml
│ │ │ ├── font_size_activity.xml
│ │ │ └── activity_config.xml
│ │ ├── ic_launcher-web.png
│ │ ├── java
│ │ └── com
│ │ │ └── layoutxml
│ │ │ └── twelveish
│ │ │ ├── WordClockListener.java
│ │ │ ├── objects
│ │ │ ├── StringOption.java
│ │ │ ├── IntegerOption.java
│ │ │ ├── FontOption.java
│ │ │ ├── BooleanOption.java
│ │ │ ├── WordClockTaskWrapper.java
│ │ │ └── ActivityOption.java
│ │ │ └── activities
│ │ │ ├── AboutActivity.java
│ │ │ ├── FontSizeInfoActivity.java
│ │ │ ├── FontSizeActivity.java
│ │ │ └── list_activities
│ │ │ ├── IntegerTextViewOptionsActivity.java
│ │ │ ├── ActivityTextViewActivity.java
│ │ │ ├── FontTextViewActivity.java
│ │ │ └── ActivityImageViewActivity.java
│ │ └── AndroidManifest.xml
├── release
│ └── output.json
├── proguard-rules.pro
└── build.gradle
├── phone
├── .gitignore
├── src
│ └── main
│ │ ├── ic_launcher-web.png
│ │ ├── res
│ │ ├── font
│ │ │ ├── cabin.ttf
│ │ │ ├── nunito.ttf
│ │ │ ├── rubik.ttf
│ │ │ ├── alegreya.ttf
│ │ │ ├── pacifico.ttf
│ │ │ ├── ibmplexsans.ttf
│ │ │ ├── inconsolata.ttf
│ │ │ ├── quicksand.ttf
│ │ │ ├── merriweather.ttf
│ │ │ └── quattrocento.ttf
│ │ ├── mipmap-hdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-mdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── drawable
│ │ │ ├── ic_launcher_web.png
│ │ │ ├── ic_send.xml
│ │ │ ├── ic_active.xml
│ │ │ ├── ic_save.xml
│ │ │ ├── ic_inactive.xml
│ │ │ └── ic_launcher_background.xml
│ │ ├── mipmap-xhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-xxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── mipmap-xxxhdpi
│ │ │ ├── ic_launcher.png
│ │ │ ├── ic_launcher_round.png
│ │ │ └── ic_launcher_foreground.png
│ │ ├── values
│ │ │ ├── ic_launcher_background.xml
│ │ │ ├── colors.xml
│ │ │ └── styles.xml
│ │ ├── mipmap-anydpi-v26
│ │ │ ├── ic_launcher.xml
│ │ │ └── ic_launcher_round.xml
│ │ ├── drawable-xhdpi
│ │ │ └── circle.xml
│ │ ├── layout
│ │ │ ├── color_selection_activity.xml
│ │ │ ├── preview_fragment.xml
│ │ │ ├── imageview_and_textview_item.xml
│ │ │ ├── switch_and_textview_item.xml
│ │ │ ├── shared_settings_fragment.xml
│ │ │ ├── complication_settings_fragment.xml
│ │ │ ├── textview_item.xml
│ │ │ ├── top_settings_fragment.xml
│ │ │ ├── home_screen.xml
│ │ │ ├── install_activity.xml
│ │ │ ├── customize_screen.xml
│ │ │ └── about_screen.xml
│ │ └── drawable-v24
│ │ │ └── ic_launcher_foreground.xml
│ │ ├── java
│ │ └── com
│ │ │ └── layoutxml
│ │ │ └── twelveish
│ │ │ ├── WordClockListener.java
│ │ │ ├── dagger
│ │ │ ├── PerCustomization.java
│ │ │ ├── App.java
│ │ │ ├── CommunicatorComponent.java
│ │ │ ├── SettingsManagerComponent.java
│ │ │ └── SettingsManagerModule.java
│ │ │ ├── PreviewTransition.java
│ │ │ ├── activities
│ │ │ ├── AboutActivityP.java
│ │ │ ├── InstallActivity.java
│ │ │ └── ColorSelectionActivity.java
│ │ │ ├── objects
│ │ │ └── WordClockTaskWrapper.java
│ │ │ ├── fragments
│ │ │ ├── PreviewFragment.java
│ │ │ ├── ComplicationSettingsFragment.java
│ │ │ ├── SharedSettingsFragment.java
│ │ │ └── MainTextSettingsFragment.java
│ │ │ ├── adapters
│ │ │ ├── OptionsPagerAdapter.java
│ │ │ ├── TextviewRecyclerViewAdapter.java
│ │ │ ├── ImageRecyclerViewAdapter.java
│ │ │ └── SwitchRecyclerViewAdapter.java
│ │ │ ├── HomeScreen.java
│ │ │ ├── SettingsManager.java
│ │ │ └── CustomizationScreen.java
│ │ └── AndroidManifest.xml
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── screenshots
├── Twelveish-1.png
├── Twelveish-2.png
├── Twelveish-3.png
├── Twelveish-4.png
├── Twelveish-5.png
├── Twelveish-Logo.png
└── Twelveish-FeatureGraphic.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .idea
├── encodings.xml
├── vcs.xml
├── modules.xml
├── runConfigurations.xml
├── jarRepositories.xml
├── misc.xml
└── codeStyles
│ └── Project.xml
├── gradle.properties
├── .gitignore
├── gradlew.bat
├── gradlew
└── README.md
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/phone/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':phone'
2 |
--------------------------------------------------------------------------------
/screenshots/Twelveish-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/screenshots/Twelveish-1.png
--------------------------------------------------------------------------------
/screenshots/Twelveish-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/screenshots/Twelveish-2.png
--------------------------------------------------------------------------------
/screenshots/Twelveish-3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/screenshots/Twelveish-3.png
--------------------------------------------------------------------------------
/screenshots/Twelveish-4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/screenshots/Twelveish-4.png
--------------------------------------------------------------------------------
/screenshots/Twelveish-5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/screenshots/Twelveish-5.png
--------------------------------------------------------------------------------
/app/src/main/res/font/cabin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/cabin.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/rubik.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/rubik.ttf
--------------------------------------------------------------------------------
/screenshots/Twelveish-Logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/screenshots/Twelveish-Logo.png
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/res/font/alegreya.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/alegreya.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/nunito.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/nunito.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/pacifico.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/pacifico.ttf
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/phone/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/phone/src/main/res/font/cabin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/cabin.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/nunito.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/nunito.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/rubik.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/rubik.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/quicksand.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/quicksand.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/alegreya.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/alegreya.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/pacifico.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/pacifico.ttf
--------------------------------------------------------------------------------
/app/src/main/res/drawable/nobglogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/drawable/nobglogo.png
--------------------------------------------------------------------------------
/app/src/main/res/font/ibmplexsans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/ibmplexsans.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/inconsolata.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/inconsolata.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/merriweather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/merriweather.ttf
--------------------------------------------------------------------------------
/app/src/main/res/font/quattrocento.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/font/quattrocento.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/ibmplexsans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/ibmplexsans.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/inconsolata.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/inconsolata.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/quicksand.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/quicksand.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/merriweather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/merriweather.ttf
--------------------------------------------------------------------------------
/phone/src/main/res/font/quattrocento.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/font/quattrocento.ttf
--------------------------------------------------------------------------------
/screenshots/Twelveish-FeatureGraphic.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/screenshots/Twelveish-FeatureGraphic.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/phone/src/main/res/drawable/ic_launcher_web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/drawable/ic_launcher_web.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/add_complication.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/drawable-hdpi/add_complication.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/preview_digital.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/drawable-nodpi/preview_digital.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/xml/watch_face.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-hdpi/added_complication.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/drawable-hdpi/added_complication.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable-nodpi/preview_digital_circular.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/app/src/main/res/drawable-nodpi/preview_digital_circular.png
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/LayoutXML/Twelveish/HEAD/phone/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2196F3
4 |
--------------------------------------------------------------------------------
/phone/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #2196F3
4 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 | #ffffff
5 |
6 |
--------------------------------------------------------------------------------
/app/release/output.json:
--------------------------------------------------------------------------------
1 | [{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":266,"versionName":"2.3.2","enabled":true,"outputFile":"phone-release.apk","fullName":"release","baseName":"release"},"path":"phone-release.apk","properties":{}}]
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/WordClockListener.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish;
2 |
3 | import com.layoutxml.twelveish.objects.WordClockTaskWrapper;
4 |
5 | public interface WordClockListener {
6 | void wordClockListener(WordClockTaskWrapper wordClockTaskWrapper);
7 | }
8 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Tue Jun 02 22:38:46 EEST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/WordClockListener.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish;
2 |
3 | import com.layoutxml.twelveish.objects.WordClockTaskWrapper;
4 |
5 | public interface WordClockListener {
6 | void wordClockListener(WordClockTaskWrapper wordClockTaskWrapper);
7 | }
8 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/phone/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
10 |
12 |
--------------------------------------------------------------------------------
/phone/src/main/res/drawable/ic_send.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
11 |
12 |
--------------------------------------------------------------------------------
/phone/src/main/res/drawable-xhdpi/circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
10 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_check.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 40sp
4 | 45sp
5 | 15dp
6 | 25dp
7 | 90dp
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/settings_watch_face_preview_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/dagger/PerCustomization.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.dagger;
2 |
3 | import java.lang.annotation.Documented;
4 | import java.lang.annotation.Retention;
5 |
6 | import javax.inject.Scope;
7 |
8 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
9 |
10 | @Scope
11 | @Documented
12 | @Retention(RUNTIME)
13 | public @interface PerCustomization {
14 | }
15 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_capitalisationp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_infop.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/PreviewTransition.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish;
2 |
3 | import android.transition.Transition;
4 | import android.transition.TransitionValues;
5 |
6 | public class PreviewTransition extends Transition {
7 | @Override
8 | public void captureStartValues(TransitionValues transitionValues) {
9 |
10 | }
11 |
12 | @Override
13 | public void captureEndValues(TransitionValues transitionValues) {
14 |
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/phone/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 | #2196f3
10 | #2196f3
11 | #b2b2b2
12 | #2196f3
13 | #212121
14 | #FAFAFA
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/wearablerecyclerview_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
--------------------------------------------------------------------------------
/phone/src/main/res/drawable/ic_active.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/phone/src/main/res/drawable/ic_save.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_complicationp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_miscp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_fontp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_datep.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/dagger/App.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.dagger;
2 |
3 | import android.app.Application;
4 |
5 | public class App extends Application {
6 |
7 | private CommunicatorComponent component;
8 |
9 | @Override
10 | public void onCreate() {
11 | super.onCreate();
12 |
13 | component = DaggerCommunicatorComponent.factory()
14 | .create(getApplicationContext());
15 | }
16 |
17 | public CommunicatorComponent getCommunicatorComponent() {
18 | return component;
19 | }
20 |
21 |
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/dagger/CommunicatorComponent.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.dagger;
2 |
3 | import android.content.Context;
4 |
5 | import com.layoutxml.twelveish.Communicator;
6 |
7 | import javax.inject.Singleton;
8 |
9 | import dagger.BindsInstance;
10 | import dagger.Component;
11 |
12 | @Singleton
13 | @Component
14 | public interface CommunicatorComponent {
15 |
16 | Communicator getCommunicator();
17 |
18 | @Component.Factory
19 | interface Factory {
20 | CommunicatorComponent create(@BindsInstance Context context);
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_showhidep.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/dagger/SettingsManagerComponent.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.dagger;
2 |
3 | import android.content.Context;
4 |
5 | import com.layoutxml.twelveish.SettingsManager;
6 |
7 | import dagger.BindsInstance;
8 | import dagger.Component;
9 |
10 | @PerCustomization
11 | @Component(modules = SettingsManagerModule.class)
12 | public interface SettingsManagerComponent {
13 |
14 | SettingsManager getSettingsManager();
15 |
16 | @Component.Factory
17 | interface Factory {
18 | SettingsManagerComponent create(@BindsInstance Context context);
19 | }
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/color_selection_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/objects/StringOption.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018. LayoutXML
3 | * Created by LayoutXML.
4 | *
5 | */
6 |
7 | package com.layoutxml.twelveish.objects;
8 |
9 | public class StringOption {
10 |
11 | public String name;
12 | public String symbol;
13 |
14 | public String getSymbol() {
15 | return symbol;
16 | }
17 |
18 | public void setSymbol(String symbol) {
19 | this.symbol = symbol;
20 | }
21 |
22 | public String getName() {
23 | return name;
24 | }
25 |
26 | public void setName(String name) {
27 | this.name = name;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/objects/IntegerOption.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018. LayoutXML
3 | * Created by LayoutXML.
4 | *
5 | */
6 |
7 | package com.layoutxml.twelveish.objects;
8 |
9 | public class IntegerOption {
10 | private String name;
11 | private Integer integer;
12 |
13 | public String getName() {
14 | return name;
15 | }
16 |
17 | public void setName(String name) {
18 | this.name = name;
19 | }
20 |
21 | public Integer getInteger() {
22 | return integer;
23 | }
24 |
25 | public void setInteger(Integer integer) {
26 | this.integer = integer;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/dagger/SettingsManagerModule.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.dagger;
2 |
3 | import android.content.Context;
4 |
5 | import com.layoutxml.twelveish.SettingsManager;
6 |
7 | import dagger.Module;
8 | import dagger.Provides;
9 |
10 | @Module
11 | public class SettingsManagerModule {
12 |
13 | @PerCustomization
14 | @Provides
15 | SettingsManager provideSettingsManager(Context context) {
16 | SettingsManager sm = new SettingsManager(context);
17 | sm.initializeDefaultBooleans();
18 | sm.initializeDefaultIntegers();
19 | sm.initializeDefaultStrings();
20 | return sm;
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/objects/FontOption.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.objects;
2 |
3 | import android.graphics.Typeface;
4 |
5 | public class FontOption {
6 |
7 | private String name;
8 | private String key;
9 | private Typeface typeface;
10 |
11 | public Typeface getTypeface() {
12 | return typeface;
13 | }
14 |
15 | public void setTypeface(Typeface typeface) {
16 | this.typeface = typeface;
17 | }
18 |
19 | public String getName() {
20 | return name;
21 | }
22 |
23 | public void setName(String name) {
24 | this.name = name;
25 | }
26 |
27 | public String getKey() {
28 | return key;
29 | }
30 |
31 | public void setKey(String key) {
32 | this.key = key;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/textview_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
23 |
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The activityOption is particularly useful for tweaking memory settings.
9 | android.enableJetifier=true
10 | android.useAndroidX=true
11 | org.gradle.jvmargs=-Xmx1536m
12 | # When configured, Gradle will run in incubating parallel mode.
13 | # This option should only be used with decoupled projects. More details, visit
14 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
15 | # org.gradle.parallel=true
16 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles activityOption in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/phone/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles activityOption in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/phone/src/main/res/drawable/ic_inactive.xml:
--------------------------------------------------------------------------------
1 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_colorp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/activities/AboutActivity.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.activities;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.widget.TextView;
6 |
7 | import com.layoutxml.twelveish.BuildConfig;
8 | import com.layoutxml.twelveish.R;
9 |
10 | public class AboutActivity extends Activity{
11 |
12 | @Override
13 | public void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.about_screen);
16 |
17 | int versionCode = BuildConfig.VERSION_CODE;
18 | String versionName = BuildConfig.VERSION_NAME;
19 |
20 | TextView License2 = findViewById(R.id.license2);
21 | License2.setText("Version name: "+versionName);
22 |
23 | TextView License3 = findViewById(R.id.license3);
24 | License3.setText("Version code: "+versionCode);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/activities/AboutActivityP.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.activities;
2 |
3 | import android.app.Activity;
4 | import android.os.Bundle;
5 | import android.widget.TextView;
6 |
7 | import com.layoutxml.twelveish.BuildConfig;
8 | import com.layoutxml.twelveish.R;
9 |
10 | public class AboutActivityP extends Activity{
11 |
12 | @Override
13 | public void onCreate(Bundle savedInstanceState) {
14 | super.onCreate(savedInstanceState);
15 | setContentView(R.layout.about_screen);
16 |
17 | int versionCode = BuildConfig.VERSION_CODE;
18 | String versionName = BuildConfig.VERSION_NAME;
19 |
20 | TextView License2 = findViewById(R.id.license2);
21 | License2.setText("Version name: "+versionName);
22 |
23 | TextView License3 = findViewById(R.id.license3);
24 | License3.setText("Version code: "+versionCode);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/preview_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
18 |
19 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/activities/InstallActivity.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.view.View;
7 | import android.widget.Button;
8 |
9 | import androidx.annotation.Nullable;
10 |
11 | import com.layoutxml.twelveish.R;
12 |
13 | public class InstallActivity extends Activity {
14 |
15 | @Override
16 | protected void onCreate(@Nullable Bundle savedInstanceState) {
17 | super.onCreate(savedInstanceState);
18 | setContentView(R.layout.install_activity);
19 |
20 | Button aboutButton = findViewById(R.id.about);
21 | aboutButton.setOnClickListener(new View.OnClickListener() {
22 | @Override
23 | public void onClick(View v) {
24 | Intent intent = new Intent(getApplicationContext(), AboutActivityP.class);
25 | startActivity(intent);
26 | }
27 | });
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/imageview_and_textview_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
21 |
22 |
30 |
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/objects/BooleanOption.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018. LayoutXML
3 | * Created by LayoutXML.
4 | *
5 | */
6 |
7 | package com.layoutxml.twelveish.objects;
8 |
9 | public class BooleanOption {
10 |
11 | private String name;
12 | private String key;
13 | private Boolean bool;
14 | private Boolean defaultOption;
15 |
16 | public Boolean getDefaultOption() {
17 | return defaultOption;
18 | }
19 |
20 | public void setDefaultOption(Boolean defaultOption) {
21 | this.defaultOption = defaultOption;
22 | }
23 |
24 | public String getKey() {
25 | return key;
26 | }
27 |
28 | public void setKey(String key) {
29 | this.key = key;
30 | }
31 |
32 | public Boolean getBool() {
33 | return bool;
34 | }
35 |
36 | public void setBool(Boolean bool) {
37 | this.bool = bool;
38 | }
39 |
40 | public String getName() {
41 | return name;
42 | }
43 |
44 | public void setName(String name) {
45 | this.name = name;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/switch_and_textview_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
22 |
23 |
31 |
32 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 29
5 | defaultConfig {
6 | applicationId "com.layoutxml.twelveish"
7 | minSdkVersion 23
8 | targetSdkVersion 29
9 | versionCode 267
10 | versionName "2.3.2"
11 | multiDexEnabled true
12 | }
13 | buildTypes {
14 | release {
15 | minifyEnabled true
16 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | implementation fileTree(dir: 'libs', include: ['*.jar'])
23 | implementation 'com.google.android.support:wearable:2.7.0'
24 | implementation 'com.google.android.gms:play-services-wearable:17.0.0'
25 | implementation 'androidx.percentlayout:percentlayout:1.0.0'
26 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
27 | implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha03'
28 | implementation 'androidx.wear:wear:1.0.0'
29 | compileOnly 'com.google.android.wearable:wearable:2.7.0'
30 | implementation "androidx.constraintlayout:constraintlayout:1.1.3"
31 | }
32 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/objects/WordClockTaskWrapper.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.objects;
2 |
3 | public class WordClockTaskWrapper {
4 |
5 | private String text;
6 | private float basey;
7 | private float textSize;
8 | private float x;
9 |
10 | public WordClockTaskWrapper(String text, float basey, float textSize, float x) {
11 | this.text = text;
12 | this.basey = basey;
13 | this.textSize = textSize;
14 | this.x = x;
15 | }
16 |
17 | public float getX() {
18 | return x;
19 | }
20 |
21 | public void setX(float x) {
22 | this.x = x;
23 | }
24 |
25 | public float getTextSize() {
26 | return textSize;
27 | }
28 |
29 | public void setTextSize(float textSize) {
30 | this.textSize = textSize;
31 | }
32 |
33 | public String getText() {
34 | return text;
35 | }
36 |
37 | public void setText(String text) {
38 | this.text = text;
39 | }
40 |
41 | public float getBasey() {
42 | return basey;
43 | }
44 |
45 | public void setBasey(float basey) {
46 | this.basey = basey;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/objects/WordClockTaskWrapper.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.objects;
2 |
3 | import com.layoutxml.twelveish.WordClockListener;
4 |
5 | public class WordClockTaskWrapper {
6 |
7 | private String text;
8 | private float basey;
9 | private float textSize;
10 | private float x;
11 |
12 | public WordClockTaskWrapper(String text, float basey, float textSize, float x) {
13 | this.text = text;
14 | this.basey = basey;
15 | this.textSize = textSize;
16 | this.x = x;
17 | }
18 |
19 | public float getX() {
20 | return x;
21 | }
22 |
23 | public void setX(float x) {
24 | this.x = x;
25 | }
26 |
27 | public float getTextSize() {
28 | return textSize;
29 | }
30 |
31 | public void setTextSize(float textSize) {
32 | this.textSize = textSize;
33 | }
34 |
35 | public String getText() {
36 | return text;
37 | }
38 |
39 | public void setText(String text) {
40 | this.text = text;
41 | }
42 |
43 | public float getBasey() {
44 | return basey;
45 | }
46 |
47 | public void setBasey(float basey) {
48 | this.basey = basey;
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/imageview_and_textview_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
22 |
23 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_languagep.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/switch_and_textview_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/shared_settings_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/complication_settings_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 |
5 | # Files for the ART/Dalvik VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # Generated files
12 | bin/
13 | gen/
14 | out/
15 |
16 | # Gradle files
17 | .gradle/
18 | build/
19 |
20 | # Local configuration file (sdk path, etc)
21 | local.properties
22 |
23 | # Proguard folder generated by Eclipse
24 | proguard/
25 |
26 | # Log Files
27 | *.log
28 |
29 | # Android Studio Navigation editor temp files
30 | .navigation/
31 |
32 | # Android Studio captures folder
33 | captures/
34 |
35 | # IntelliJ
36 | *.iml
37 | .idea/workspace.xml
38 | .idea/tasks.xml
39 | .idea/gradle.xml
40 | .idea/assetWizardSettings.xml
41 | .idea/dictionaries
42 | .idea/libraries
43 | .idea/caches
44 |
45 | # Keystore files
46 | # Uncomment the following line if you do not want to check your keystore files in.
47 | #*.jks
48 |
49 | # External native build folder generated in Android Studio 2.2 and later
50 | .externalNativeBuild
51 |
52 | # Google Services (e.g. APIs or Firebase)
53 | google-services.json
54 |
55 | # Freeline
56 | freeline.py
57 | freeline/
58 | freeline_project_description.json
59 |
60 | # fastlane
61 | fastlane/report.xml
62 | fastlane/Preview.html
63 | fastlane/screenshots
64 | fastlane/test_output
65 | fastlane/readme.md
66 | .idea/workspace.xml___jb_old___
67 | .idea/misc.xml
68 | .idea/misc.xml
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/objects/ActivityOption.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018. LayoutXML
3 | * Created by LayoutXML.
4 | *
5 | */
6 |
7 | package com.layoutxml.twelveish.objects;
8 |
9 | public class ActivityOption {
10 | private String name;
11 | private Integer icon;
12 | private Class activity;
13 | private String extra;
14 | private String extra2;
15 |
16 | public ActivityOption() {
17 | extra = "";
18 | extra2 = "";
19 | }
20 |
21 | public String getExtra2() {
22 | return extra2;
23 | }
24 |
25 | public void setExtra2(String extra2) {
26 | this.extra2 = extra2;
27 | }
28 |
29 | public String getExtra() {
30 | return extra;
31 | }
32 |
33 | public void setExtra(String extra) {
34 | this.extra = extra;
35 | }
36 |
37 | public Class getActivity() {
38 | return activity;
39 | }
40 |
41 | public void setActivity(Class activity) {
42 | this.activity = activity;
43 | }
44 |
45 | public String getName() {
46 | return name;
47 | }
48 |
49 | public void setName(String name) {
50 | this.name = name;
51 | }
52 |
53 | public Integer getIcon() {
54 | return icon;
55 | }
56 |
57 | public void setIcon(Integer icon) {
58 | this.icon = icon;
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/textview_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
15 |
16 |
26 |
27 |
36 |
37 |
--------------------------------------------------------------------------------
/phone/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/fragments/PreviewFragment.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.fragments;
2 |
3 | import android.os.Bundle;
4 | import android.util.Log;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.annotation.Nullable;
11 | import androidx.fragment.app.Fragment;
12 |
13 | import com.layoutxml.twelveish.CustomizationScreen;
14 | import com.layoutxml.twelveish.R;
15 | import com.layoutxml.twelveish.objects.WatchPreviewView;
16 |
17 | public class PreviewFragment extends Fragment implements CustomizationScreen.AmoledChange {
18 |
19 | private WatchPreviewView previewView;
20 | private static final String TAG = "PreviewFragment";
21 |
22 | @Nullable
23 | @Override
24 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
25 | View view = inflater.inflate(R.layout.preview_fragment,container,false);
26 |
27 | previewView = view.findViewById(R.id.viewWatch);
28 |
29 | return view;
30 | }
31 |
32 | @Override
33 | public void ambientModeChange(boolean value) {
34 | previewView.changeAmbientMode(value);
35 | Log.d(TAG, "ambientModeChange: "+value);
36 | }
37 |
38 | public void invalidate() {
39 | previewView.invalidate();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/custom_complication_styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
27 |
28 |
35 |
--------------------------------------------------------------------------------
/phone/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018. LayoutXML
3 | * Created by LayoutXML.
4 | *
5 | */
6 |
7 | apply plugin: 'com.android.application'
8 |
9 | android {
10 | compileSdkVersion 29
11 |
12 | defaultConfig {
13 | applicationId "com.layoutxml.twelveish"
14 | minSdkVersion 21
15 | targetSdkVersion 29
16 | versionCode 266
17 | versionName "2.3.2"
18 |
19 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
20 |
21 | }
22 |
23 | buildTypes {
24 | release {
25 | minifyEnabled true
26 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27 | }
28 | }
29 |
30 | }
31 |
32 | dependencies {
33 | implementation fileTree(dir: 'libs', include: ['*.jar'])
34 | implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
35 | implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
36 | testImplementation 'junit:junit:4.12'
37 | androidTestImplementation 'androidx.test:runner:1.2.0'
38 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
39 | implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha03'
40 | wearApp project(':app')
41 | implementation 'com.google.android.gms:play-services-wearable:17.0.0'
42 | implementation 'com.google.android.material:material:1.1.0'
43 | implementation 'com.google.dagger:dagger:2.22.1'
44 | annotationProcessor 'com.google.dagger:dagger-compiler:2.22.1'
45 | }
--------------------------------------------------------------------------------
/phone/src/main/res/layout/top_settings_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
20 |
21 |
26 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/adapters/OptionsPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.adapters;
2 |
3 | import androidx.annotation.NonNull;
4 | import androidx.annotation.Nullable;
5 | import androidx.fragment.app.Fragment;
6 | import androidx.fragment.app.FragmentManager;
7 | import androidx.fragment.app.FragmentStatePagerAdapter;
8 |
9 | import com.layoutxml.twelveish.fragments.ComplicationSettingsFragment;
10 | import com.layoutxml.twelveish.fragments.MainTextSettingsFragment;
11 | import com.layoutxml.twelveish.fragments.SharedSettingsFragment;
12 | import com.layoutxml.twelveish.fragments.TopSettingsFragment;
13 |
14 | public class OptionsPagerAdapter extends FragmentStatePagerAdapter {
15 |
16 | public OptionsPagerAdapter(@NonNull FragmentManager fm, int behavior) {
17 | super(fm, behavior);
18 | }
19 |
20 | @NonNull
21 | @Override
22 | public Fragment getItem(int position) {
23 | switch (position) {
24 | default:
25 | return new ComplicationSettingsFragment();
26 | case 0:
27 | return new ComplicationSettingsFragment();
28 | case 1:
29 | return new TopSettingsFragment();
30 | case 2:
31 | return new MainTextSettingsFragment();
32 | case 3:
33 | return new SharedSettingsFragment();
34 | }
35 | }
36 |
37 | @Override
38 | public int getCount() {
39 | return 4;
40 | }
41 |
42 | @Nullable
43 | @Override
44 | public CharSequence getPageTitle(int position) {
45 | switch (position) {
46 | default:
47 | return null;
48 | case 0:
49 | return "Complications";
50 | case 1:
51 | return "Top";
52 | case 2:
53 | return "Main text";
54 | case 3:
55 | return "Shared";
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/phone/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
13 |
14 |
15 |
16 |
25 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/phone/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
13 |
18 |
19 |
25 |
28 |
31 |
32 |
33 |
34 |
40 |
41 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/font_size_info_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
18 |
22 |
23 |
31 |
32 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/activities/FontSizeInfoActivity.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.Intent;
6 | import android.content.SharedPreferences;
7 | import android.os.Bundle;
8 | import android.view.View;
9 | import android.widget.Button;
10 | import android.widget.TextView;
11 |
12 | import com.layoutxml.twelveish.R;
13 |
14 | public class FontSizeInfoActivity extends Activity {
15 |
16 | @Override
17 | public void onCreate(Bundle savedInstanceState) {
18 | super.onCreate(savedInstanceState);
19 | setContentView(R.layout.font_size_info_activity);
20 |
21 | TextView main = findViewById(R.id.infoText);
22 | Button okayButton = findViewById(R.id.okay);
23 |
24 | SharedPreferences sharedPreferences = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
25 | int mainSize = sharedPreferences.getInt(getString(R.string.main_text_size_offset),0);
26 | int secondarySize = sharedPreferences.getInt(getString(R.string.secondary_text_size_offset),0);
27 | int actualMainTextSize = sharedPreferences.getInt(getString(R.string.main_text_size_real),24);
28 |
29 | main.setText("Usage not recommended.\n\n" +
30 | "This option allows increasing or decreasing text sizes.\n\n" +
31 | "By increasing them, items may overlap or go off screen.\n" +
32 | "By decreasing them, text will be smaller.\n\n" +
33 | "Main text size by default is automatically calculated to fit the screen and secondary text size is static.\n\n" +
34 | "For reference, these are current text sizes:\n" +
35 | "Main text: "+actualMainTextSize+" + "+mainSize+" (offset),\n" +
36 | "Secondary: 24 + "+secondarySize+" (offset).\n");
37 |
38 | okayButton.setOnClickListener(new View.OnClickListener(){
39 | @Override
40 | public void onClick(View v) {
41 | Intent intent;
42 | intent = new Intent(FontSizeInfoActivity.this, FontSizeActivity.class);
43 | FontSizeInfoActivity.this.startActivity(intent);
44 | finish();
45 | }
46 | });
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/activities/FontSizeActivity.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.SharedPreferences;
6 | import android.os.Bundle;
7 | import android.view.View;
8 | import android.widget.Button;
9 | import android.widget.EditText;
10 | import android.widget.Toast;
11 |
12 | import com.layoutxml.twelveish.R;
13 |
14 | public class FontSizeActivity extends Activity {
15 |
16 | private int main;
17 | private int secondary;
18 | private SharedPreferences sharedPreferences;
19 | private EditText mainText;
20 | private EditText secondaryText;
21 | private Button submit;
22 |
23 | @Override
24 | public void onCreate(Bundle savedInstanceState) {
25 | super.onCreate(savedInstanceState);
26 | setContentView(R.layout.font_size_activity);
27 |
28 | sharedPreferences = getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
29 | main = sharedPreferences.getInt(getString(R.string.main_text_size_offset),0);
30 | secondary = sharedPreferences.getInt(getString(R.string.secondary_text_size_offset),0);
31 |
32 | mainText = findViewById(R.id.batteryMin);
33 | secondaryText = findViewById(R.id.batteryMax);
34 | submit = findViewById(R.id.battery_submit);
35 |
36 | mainText.setText(main +"");
37 | secondaryText.setText(secondary +"");
38 |
39 | submit.setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View v) {
42 | try {
43 | int newMin = Integer.parseInt(mainText.getText().toString());
44 | int newMax = Integer.parseInt(secondaryText.getText().toString());
45 | sharedPreferences.edit().putInt(getString(R.string.main_text_size_offset), newMin).apply();
46 | sharedPreferences.edit().putInt(getString(R.string.secondary_text_size_offset), newMax).apply();
47 | Toast.makeText(getApplicationContext(), newMin + " and " + newMax + " set", Toast.LENGTH_SHORT).show();
48 | finish();
49 | } catch (NumberFormatException e) {
50 | Toast.makeText(getApplicationContext(), "Invalid input. Only numbers and '.' are allowed.", Toast.LENGTH_SHORT).show();
51 | finish();
52 | }
53 | }
54 | });
55 |
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/adapters/TextviewRecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.adapters;
2 |
3 | import android.content.Context;
4 | import android.util.Pair;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.TextView;
9 |
10 | import androidx.annotation.NonNull;
11 | import androidx.recyclerview.widget.RecyclerView;
12 |
13 | import com.layoutxml.twelveish.R;
14 |
15 | import java.util.List;
16 |
17 | public class TextviewRecyclerViewAdapter extends RecyclerView.Adapter {
18 |
19 | private List> mData;
20 | private LayoutInflater mInflater;
21 | private ItemClickListener mClickListener;
22 | private String name=""; //adapter name
23 |
24 | public TextviewRecyclerViewAdapter(Context context, List> data, String name) {
25 | this.mInflater = LayoutInflater.from(context);
26 | this.mData = data;
27 | this.name = name;
28 | }
29 |
30 | @NonNull
31 | @Override
32 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
33 | View view = mInflater.inflate(R.layout.textview_item, parent, false);
34 | return new ViewHolder(view);
35 | }
36 |
37 | @Override
38 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
39 | String title = mData.get(position).first;
40 | String content = mData.get(position).second;
41 | holder.myTextView.setText(title);
42 | holder.myTextView2.setText(content);
43 | }
44 |
45 | @Override
46 | public int getItemCount() {
47 | return mData.size();
48 | }
49 |
50 | public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
51 | TextView myTextView, myTextView2;
52 |
53 | ViewHolder(View itemView) {
54 | super(itemView);
55 | myTextView = itemView.findViewById(R.id.titleTextView);
56 | myTextView2 = itemView.findViewById(R.id.contentTextView);
57 | itemView.setOnClickListener(this);
58 | }
59 |
60 | @Override
61 | public void onClick(View view) {
62 | if (mClickListener != null) mClickListener.onItemClick(view, getAdapterPosition(), name);
63 | }
64 | }
65 |
66 | String getItem(int id) {
67 | return mData.get(id).first;
68 | }
69 |
70 | public void setClickListener(ItemClickListener itemClickListener) {
71 | this.mClickListener = itemClickListener;
72 | }
73 |
74 | public interface ItemClickListener {
75 | void onItemClick(View view, int position, String name);
76 | }
77 | }
--------------------------------------------------------------------------------
/app/src/main/res/layout/about_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
17 |
18 |
22 |
23 |
31 |
32 |
39 |
40 |
47 |
48 |
53 |
54 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/adapters/ImageRecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.adapters;
2 |
3 | import android.content.Context;
4 | import android.graphics.drawable.Drawable;
5 | import android.util.Pair;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ImageView;
10 | import android.widget.Switch;
11 | import android.widget.TextView;
12 |
13 | import androidx.annotation.NonNull;
14 | import androidx.recyclerview.widget.RecyclerView;
15 |
16 | import com.layoutxml.twelveish.R;
17 |
18 | import java.util.List;
19 |
20 | public class ImageRecyclerViewAdapter extends RecyclerView.Adapter {
21 |
22 | private List> mData;
23 | private LayoutInflater mInflater;
24 | private ItemClickImageListener mClickListener;
25 | private String name=""; //adapter name
26 |
27 | public ImageRecyclerViewAdapter(Context context, List> data, String name) {
28 | this.mInflater = LayoutInflater.from(context);
29 | this.mData = data;
30 | this.name = name;
31 | }
32 |
33 | @NonNull
34 | @Override
35 | public ImageRecyclerViewAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
36 | View view = mInflater.inflate(R.layout.imageview_and_textview_item, parent, false);
37 | return new ImageRecyclerViewAdapter.ViewHolder(view);
38 | }
39 |
40 | @Override
41 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
42 | String title = mData.get(position).first;
43 | Integer value = mData.get(position).second;
44 | holder.myTextView.setText(title);
45 | holder.myImage.setColorFilter(value, android.graphics.PorterDuff.Mode.SRC_IN);
46 | }
47 |
48 | @Override
49 | public int getItemCount() {
50 | return mData.size();
51 | }
52 |
53 | public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
54 | TextView myTextView;
55 | ImageView myImage;
56 |
57 | ViewHolder(View itemView) {
58 | super(itemView);
59 | myTextView = itemView.findViewById(R.id.titleImageTextView);
60 | myImage = itemView.findViewById(R.id.imageImageView);
61 | itemView.setOnClickListener(this);
62 | }
63 |
64 | @Override
65 | public void onClick(View view) {
66 | if (mClickListener != null) {
67 | mClickListener.onItemClickImage(view, getAdapterPosition(), mData.get(getAdapterPosition()).second, name);
68 | }
69 | }
70 | }
71 |
72 | String getItem(int id) {
73 | return mData.get(id) .first;
74 | }
75 |
76 | public void setClickListener(ItemClickImageListener itemClickListener) {
77 | this.mClickListener = itemClickListener;
78 | }
79 |
80 | public interface ItemClickImageListener {
81 | void onItemClickImage(View view, int position, Integer currentColor, String name);
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/home_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
23 |
24 |
36 |
37 |
49 |
50 |
56 |
57 |
70 |
71 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/install_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
14 |
15 |
25 |
26 |
35 |
36 |
42 |
43 |
54 |
55 |
64 |
65 |
66 |
72 |
73 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/HomeScreen.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.util.Log;
6 | import android.view.View;
7 | import android.widget.Button;
8 | import android.widget.FrameLayout;
9 |
10 | import androidx.appcompat.app.AppCompatActivity;
11 | import androidx.core.app.ActivityOptionsCompat;
12 | import androidx.fragment.app.Fragment;
13 | import androidx.fragment.app.FragmentManager;
14 | import androidx.fragment.app.FragmentTransaction;
15 |
16 | import com.google.android.gms.wearable.Wearable;
17 | import com.layoutxml.twelveish.activities.InstallActivity;
18 | import com.layoutxml.twelveish.dagger.App;
19 | import com.layoutxml.twelveish.fragments.PreviewFragment;
20 |
21 | public class HomeScreen extends AppCompatActivity {
22 |
23 | private Communicator communicator;
24 | private static final String TAG = "HomeScreen";
25 | private FragmentManager fragmentManager;
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.home_screen);
31 |
32 | communicator = ((App) getApplication()).getCommunicatorComponent().getCommunicator();
33 | communicator.initiateHandshake();
34 | Log.d(TAG, "communicatorID" + communicator);
35 |
36 | final View preview = findViewById(R.id.fragmentPreview);
37 |
38 | Button buttonCustomize = findViewById(R.id.buttonCustomize);
39 | buttonCustomize.setOnClickListener(new View.OnClickListener() {
40 | @Override
41 | public void onClick(View v) {
42 | Intent intent = new Intent(getApplicationContext(),CustomizationScreen.class);
43 | ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(HomeScreen.this, preview, "preview");
44 | startActivity(intent, options.toBundle());
45 | }
46 | });
47 |
48 | Button install = findViewById(R.id.buttonInstall);
49 | install.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View v) {
52 | Intent intent = new Intent(getApplicationContext(), InstallActivity.class);
53 | startActivity(intent);
54 | }
55 | });
56 | }
57 |
58 | @Override
59 | protected void onPause() {
60 | super.onPause();
61 | Wearable.getDataClient(getApplicationContext()).removeListener(communicator); //unregistering and registering in every activity separately
62 | //because we want to unregister when application closes and there's no onPause/onDestroy for classes like App.java that extend Application
63 | }
64 |
65 | @Override
66 | protected void onResume() {
67 | super.onResume();
68 | Wearable.getDataClient(getApplicationContext()).addListener(communicator);
69 | communicator.initiateHandshake();
70 |
71 | fragmentManager = getSupportFragmentManager();
72 | FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
73 |
74 | Fragment previewFragment = new PreviewFragment();
75 | fragmentTransaction.replace(R.id.fragmentPreview,previewFragment);
76 | fragmentTransaction.commit();
77 | }
78 | }
79 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/adapters/SwitchRecyclerViewAdapter.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.adapters;
2 |
3 | import android.content.Context;
4 | import android.util.Pair;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.widget.Switch;
9 | import android.widget.TextView;
10 |
11 | import androidx.annotation.NonNull;
12 | import androidx.recyclerview.widget.RecyclerView;
13 |
14 | import com.layoutxml.twelveish.R;
15 | import com.layoutxml.twelveish.SettingsManager;
16 |
17 | import java.util.List;
18 |
19 | public class SwitchRecyclerViewAdapter extends RecyclerView.Adapter {
20 |
21 | private List> mData;
22 | private LayoutInflater mInflater;
23 | private ItemClickSwitchListener mClickListener;
24 | private String name=""; //adapter name
25 | private SettingsManager settingsManager;
26 |
27 | public SwitchRecyclerViewAdapter(Context context, List> data, String name, SettingsManager settingsManager) {
28 | this.mInflater = LayoutInflater.from(context);
29 | this.mData = data;
30 | this.name = name;
31 | this.settingsManager = settingsManager;
32 | }
33 |
34 | @NonNull
35 | @Override
36 | public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
37 | View view = mInflater.inflate(R.layout.switch_and_textview_item, parent, false);
38 | return new ViewHolder(view);
39 | }
40 |
41 | @Override
42 | public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
43 | String title = mData.get(position).first;
44 | String key = mData.get(position).second;
45 | holder.myTextView.setText(title);
46 | holder.mySwtich.setChecked(settingsManager.booleanHashmap.get(key));
47 | }
48 |
49 | @Override
50 | public int getItemCount() {
51 | return mData.size();
52 | }
53 |
54 | public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
55 | TextView myTextView;
56 | Switch mySwtich;
57 |
58 | ViewHolder(View itemView) {
59 | super(itemView);
60 | myTextView = itemView.findViewById(R.id.titleSwitchTextView);
61 | mySwtich = itemView.findViewById(R.id.switchSwitch);
62 | itemView.setOnClickListener(this);
63 | }
64 |
65 | @Override
66 | public void onClick(View view) {
67 | if (mClickListener != null) {
68 | String key = mData.get(getAdapterPosition()).second;
69 | if (key.equals("showDay") || key.equals("showDayAmbient") || key.equals("showSecondaryCalendarActive") || key.equals("showSecondaryCalendar") || key.equals("militarytextTime")) {
70 | settingsManager.significantTimeChange = true;
71 | }
72 | boolean newValue = !settingsManager.booleanHashmap.get(key);
73 | settingsManager.booleanHashmap.put(key,newValue);
74 | mySwtich.setChecked(newValue);
75 | mClickListener.onItemClickSwitch(view, getAdapterPosition(), newValue, name);
76 | }
77 | }
78 | }
79 |
80 | String getItem(int id) {
81 | return mData.get(id).first;
82 | }
83 |
84 | public void setClickListener(ItemClickSwitchListener itemClickListener) {
85 | this.mClickListener = itemClickListener;
86 | }
87 |
88 | public interface ItemClickSwitchListener {
89 | void onItemClickSwitch(View view, int position, boolean newValue, String name);
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | xmlns:android
14 |
15 | ^$
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | xmlns:.*
25 |
26 | ^$
27 |
28 |
29 | BY_NAME
30 |
31 |
32 |
33 |
34 |
35 |
36 | .*:id
37 |
38 | http://schemas.android.com/apk/res/android
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 | .*:name
48 |
49 | http://schemas.android.com/apk/res/android
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | name
59 |
60 | ^$
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 | style
70 |
71 | ^$
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | .*
81 |
82 | ^$
83 |
84 |
85 | BY_NAME
86 |
87 |
88 |
89 |
90 |
91 |
92 | .*
93 |
94 | http://schemas.android.com/apk/res/android
95 |
96 |
97 | ANDROID_ATTRIBUTE_ORDER
98 |
99 |
100 |
101 |
102 |
103 |
104 | .*
105 |
106 | .*
107 |
108 |
109 | BY_NAME
110 |
111 |
112 |
113 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/fragments/ComplicationSettingsFragment.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.fragments;
2 |
3 | import android.os.Bundle;
4 | import android.util.Pair;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 |
9 | import androidx.annotation.NonNull;
10 | import androidx.annotation.Nullable;
11 | import androidx.fragment.app.Fragment;
12 | import androidx.recyclerview.widget.LinearLayoutManager;
13 | import androidx.recyclerview.widget.RecyclerView;
14 |
15 | import com.layoutxml.twelveish.CustomizationScreen;
16 | import com.layoutxml.twelveish.R;
17 | import com.layoutxml.twelveish.SettingsManager;
18 | import com.layoutxml.twelveish.adapters.SwitchRecyclerViewAdapter;
19 | import com.layoutxml.twelveish.adapters.TextviewRecyclerViewAdapter;
20 |
21 | import java.util.ArrayList;
22 | import java.util.List;
23 |
24 | public class ComplicationSettingsFragment extends Fragment implements TextviewRecyclerViewAdapter.ItemClickListener, SwitchRecyclerViewAdapter.ItemClickSwitchListener {
25 |
26 | private TextviewRecyclerViewAdapter adapterSC;
27 | private SwitchRecyclerViewAdapter adapterBO;
28 | private final String complicationSCName = "complicationSC";
29 | private final String complicationBOName = "complicationBO";
30 | private SettingsManager settingsManager;
31 | private CustomizationScreen activity;
32 |
33 | @Nullable
34 | @Override
35 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
36 |
37 | View view = inflater.inflate(R.layout.complication_settings_fragment,container,false);
38 |
39 | activity = (CustomizationScreen) getContext();
40 | settingsManager = activity.getSettingsManagerComponent().getSettingsManager();
41 |
42 | List> optionsSC = new ArrayList>();
43 | optionsSC.add(new Pair("Left Complication","Click to launch menu on your watch"));
44 | optionsSC.add(new Pair("Right Complication","Click to launch menu on your watch"));
45 | optionsSC.add(new Pair("Bottom Complication","Click to launch menu on your watch"));
46 |
47 | List> optionsBO = new ArrayList<>();
48 | optionsBO.add(new Pair("Disable complication tap actions",getString(R.string.preference_tap_complications)));
49 |
50 | RecyclerView recyclerViewSC = view.findViewById(R.id.setComplicationsRV);
51 | recyclerViewSC.setLayoutManager(new LinearLayoutManager(getContext()));
52 | adapterSC = new TextviewRecyclerViewAdapter(getContext(),optionsSC, complicationSCName);
53 | adapterSC.setClickListener(this);
54 | recyclerViewSC.setAdapter(adapterSC);
55 |
56 | RecyclerView recyclerViewBO = view.findViewById(R.id.complicationsSwitchRV);
57 | recyclerViewBO.setLayoutManager(new LinearLayoutManager(getContext()));
58 | adapterBO = new SwitchRecyclerViewAdapter(getContext(),optionsBO, complicationBOName, settingsManager);
59 | adapterBO.setClickListener(this);
60 | recyclerViewBO.setAdapter(adapterBO);
61 |
62 | return view;
63 | }
64 |
65 | @Override
66 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
67 | super.onViewCreated(view, savedInstanceState);
68 | }
69 |
70 | @Override
71 | public void onItemClick(View view, int position, String name) {
72 | if (name.equals(complicationSCName)) {
73 | //TODO: launch activities
74 | }
75 | }
76 |
77 | @Override
78 | public void onItemClickSwitch(View view, int position, boolean newValue, String name) {
79 | if (name.equals(complicationBOName)) {
80 | activity.invalidatePreview();
81 | }
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/SettingsManager.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish;
2 |
3 | import android.content.Context;
4 |
5 | import java.util.HashMap;
6 |
7 | public class SettingsManager {
8 |
9 | public HashMap booleanHashmap;
10 | public HashMap integerHashmap;
11 | public HashMap stringHashmap;
12 | private Context context;
13 | public boolean significantTimeChange = false;
14 |
15 | public SettingsManager(Context context) {
16 | booleanHashmap = new HashMap<>();
17 | integerHashmap = new HashMap<>();
18 | stringHashmap = new HashMap<>();
19 | this.context = context;
20 | }
21 |
22 | public void initializeDefaultBooleans() {
23 | booleanHashmap.put(context.getResources().getString(R.string.preference_military_time),false);
24 | booleanHashmap.put(context.getResources().getString(R.string.preference_military_text_time),false);
25 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_digital_clock),true);
26 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_digital_clock_ambient),true);
27 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_calendar),true);
28 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_calendar_ambient),true);
29 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_battery),true);
30 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_battery_ambient),true);
31 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_day),true);
32 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_day_ambient),true);
33 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_seconds),true);
34 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_complications),true);
35 | booleanHashmap.put(context.getResources().getString(R.string.preference_show_complications_ambient),true);
36 | booleanHashmap.put(context.getResources().getString(R.string.preference_tap_complications),false);
37 | }
38 |
39 | public void initializeDefaultIntegers() {
40 | integerHashmap.put(context.getResources().getString(R.string.preference_background_color),android.graphics.Color.parseColor("#000000"));
41 | integerHashmap.put(context.getResources().getString(R.string.preference_main_text_color),android.graphics.Color.parseColor("#ffffff"));
42 | integerHashmap.put(context.getResources().getString(R.string.preference_main_text_color_ambient),android.graphics.Color.parseColor("#ffffff"));
43 | integerHashmap.put(context.getResources().getString(R.string.preference_secondary_text_color),android.graphics.Color.parseColor("#ffffff"));
44 | integerHashmap.put(context.getResources().getString(R.string.preference_secondary_text_color_ambient),android.graphics.Color.parseColor("#ffffff"));
45 | integerHashmap.put(context.getResources().getString(R.string.preference_date_order),0);
46 | integerHashmap.put(context.getResources().getString(R.string.preference_capitalisation),0);
47 | integerHashmap.put(context.getResources().getString(R.string.main_text_size_offset),0);
48 | integerHashmap.put(context.getResources().getString(R.string.secondary_text_size_offset),0);
49 | }
50 |
51 | public void initializeDefaultStrings() {
52 | stringHashmap.put(context.getResources().getString(R.string.preference_date_separator),"/");
53 | stringHashmap.put(context.getResources().getString(R.string.preference_language),"en");
54 | stringHashmap.put(context.getResources().getString(R.string.preference_font),"robotolight");
55 | stringHashmap.put(context.getResources().getString(R.string.preference_font_secondary),"robotolight");
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/font_size_activity.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
18 |
19 |
31 |
32 |
44 |
45 |
55 |
56 |
62 |
63 |
77 |
78 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/customize_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
23 |
24 |
38 |
39 |
53 |
54 |
63 |
64 |
65 |
66 |
72 |
73 |
84 |
85 |
86 |
87 |
96 |
97 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
14 |
21 |
22 |
32 |
33 |
44 |
45 |
55 |
56 |
67 |
68 |
79 |
80 |
93 |
--------------------------------------------------------------------------------
/phone/src/main/res/layout/about_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
12 |
13 |
26 |
27 |
38 |
39 |
50 |
51 |
63 |
64 |
77 |
78 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/CustomizationScreen.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish;
2 |
3 | import android.os.Bundle;
4 | import android.util.Log;
5 | import android.view.View;
6 | import android.widget.ImageButton;
7 |
8 | import androidx.annotation.Nullable;
9 | import androidx.appcompat.app.AppCompatActivity;
10 | import androidx.fragment.app.FragmentManager;
11 | import androidx.fragment.app.FragmentStatePagerAdapter;
12 | import androidx.fragment.app.FragmentTransaction;
13 | import androidx.viewpager.widget.ViewPager;
14 |
15 | import com.google.android.gms.wearable.Wearable;
16 | import com.google.android.material.tabs.TabLayout;
17 | import com.layoutxml.twelveish.adapters.OptionsPagerAdapter;
18 | import com.layoutxml.twelveish.dagger.App;
19 | import com.layoutxml.twelveish.dagger.DaggerSettingsManagerComponent;
20 | import com.layoutxml.twelveish.dagger.SettingsManagerComponent;
21 | import com.layoutxml.twelveish.fragments.PreviewFragment;
22 |
23 | public class CustomizationScreen extends AppCompatActivity {
24 |
25 | private SettingsManagerComponent settingsManagerComponent;
26 | private Communicator communicator;
27 | private static final String TAG = "CustomizationScreen";
28 | private boolean isInAmoledMode = false;
29 | private PreviewFragment previewFragment;
30 |
31 | @Override
32 | protected void onCreate(@Nullable Bundle savedInstanceState) {
33 | super.onCreate(savedInstanceState);
34 | setContentView(R.layout.customize_screen);
35 |
36 | communicator = ((App) getApplication()).getCommunicatorComponent().getCommunicator();
37 | communicator.initiateHandshake();
38 | Log.d(TAG, "communicatorID" + communicator);
39 |
40 | settingsManagerComponent = DaggerSettingsManagerComponent.factory().create(getApplicationContext());
41 |
42 | FragmentManager fragmentManager = getSupportFragmentManager();
43 | FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
44 |
45 | previewFragment = new PreviewFragment();
46 | fragmentTransaction.replace(R.id.fragmentPreview,previewFragment);
47 |
48 | ViewPager viewPager = findViewById(R.id.pagerOptions);
49 | OptionsPagerAdapter optionsPagerAdapter = new OptionsPagerAdapter(getSupportFragmentManager(), FragmentStatePagerAdapter.BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT);
50 | viewPager.setAdapter(optionsPagerAdapter);
51 | viewPager.setOffscreenPageLimit(4);
52 |
53 | TabLayout tabLayout = findViewById(R.id.tabLayout);
54 | tabLayout.setupWithViewPager(viewPager);
55 |
56 | fragmentTransaction.commit();
57 |
58 | final ImageButton changeAmbientMode = findViewById(R.id.changeModeButton);
59 | changeAmbientMode.setOnClickListener(new View.OnClickListener() {
60 | @Override
61 | public void onClick(View v) {
62 | Log.d(TAG, "onClick: ambient change button. Old value: "+isInAmoledMode);
63 | isInAmoledMode = !isInAmoledMode;
64 | if (isInAmoledMode) {
65 | changeAmbientMode.setImageDrawable(getDrawable(R.drawable.ic_inactive));
66 | } else {
67 | changeAmbientMode.setImageDrawable(getDrawable(R.drawable.ic_active));
68 | }
69 | previewFragment.ambientModeChange(isInAmoledMode);
70 | invalidatePreview();
71 | }
72 | });
73 | }
74 |
75 | @Override
76 | protected void onPause() {
77 | super.onPause();
78 | Wearable.getDataClient(getApplicationContext()).removeListener(communicator); //unregistering and registering in every activity separately
79 | //because we want to unregister when application closes and there's no onPause/onDestroy for classes like App.java that extend Application
80 | }
81 |
82 | @Override
83 | protected void onResume() {
84 | super.onResume();
85 | Wearable.getDataClient(getApplicationContext()).addListener(communicator);
86 | communicator.initiateHandshake();
87 | }
88 |
89 | public SettingsManagerComponent getSettingsManagerComponent() {
90 | return settingsManagerComponent;
91 | }
92 |
93 | public interface AmoledChange {
94 | public void ambientModeChange(boolean value);
95 | }
96 |
97 | public void invalidatePreview() {
98 | previewFragment.invalidate();
99 | }
100 | }
101 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/fragments/SharedSettingsFragment.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.fragments;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.graphics.Color;
6 | import android.os.Bundle;
7 | import android.util.Pair;
8 | import android.view.LayoutInflater;
9 | import android.view.View;
10 | import android.view.ViewGroup;
11 |
12 | import androidx.annotation.NonNull;
13 | import androidx.annotation.Nullable;
14 | import androidx.fragment.app.Fragment;
15 | import androidx.recyclerview.widget.LinearLayoutManager;
16 | import androidx.recyclerview.widget.RecyclerView;
17 |
18 | import com.layoutxml.twelveish.CustomizationScreen;
19 | import com.layoutxml.twelveish.R;
20 | import com.layoutxml.twelveish.SettingsManager;
21 | import com.layoutxml.twelveish.activities.ColorSelectionActivity;
22 | import com.layoutxml.twelveish.adapters.ImageRecyclerViewAdapter;
23 | import com.layoutxml.twelveish.adapters.SwitchRecyclerViewAdapter;
24 | import com.layoutxml.twelveish.adapters.TextviewRecyclerViewAdapter;
25 |
26 | import java.util.ArrayList;
27 | import java.util.List;
28 |
29 | public class SharedSettingsFragment extends Fragment implements ImageRecyclerViewAdapter.ItemClickImageListener, TextviewRecyclerViewAdapter.ItemClickListener{
30 |
31 | private ImageRecyclerViewAdapter adapterMI;
32 | private TextviewRecyclerViewAdapter adapterMT;
33 | private final String settingsMIName = "settingsSI";
34 | private final String settingsMTName = "settingsST";
35 | private SettingsManager settingsManager;
36 | private CustomizationScreen activity;
37 | private List> optionsTI;
38 |
39 | @Nullable
40 | @Override
41 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
42 | View view = inflater.inflate(R.layout.shared_settings_fragment,container,false);
43 |
44 | activity = (CustomizationScreen) getContext();
45 | settingsManager = activity.getSettingsManagerComponent().getSettingsManager();
46 |
47 | optionsTI = new ArrayList<>();
48 | generateColorOptions();
49 |
50 | List> optionsTT = new ArrayList<>();
51 | optionsTT.add(new Pair("Language","Currently set "+settingsManager.stringHashmap.get(getResources().getString(R.string.preference_language))));
52 |
53 | RecyclerView recyclerViewTI = view.findViewById(R.id.topImageRV);
54 | recyclerViewTI.setLayoutManager(new LinearLayoutManager(getContext()));
55 | adapterMI = new ImageRecyclerViewAdapter(getContext(),optionsTI, settingsMIName);
56 | adapterMI.setClickListener(this);
57 | recyclerViewTI.setAdapter(adapterMI);
58 |
59 | RecyclerView recyclerViewTT = view.findViewById(R.id.topTextRV);
60 | recyclerViewTT.setLayoutManager(new LinearLayoutManager(getContext()));
61 | adapterMT = new TextviewRecyclerViewAdapter(getContext(),optionsTT, settingsMTName);
62 | adapterMT.setClickListener(this);
63 | recyclerViewTT.setAdapter(adapterMT);
64 |
65 | return view;
66 | }
67 |
68 | private void generateColorOptions() {
69 | optionsTI.clear();
70 | optionsTI.add(new Pair("Background Color",settingsManager.integerHashmap.get(getResources().getString(R.string.preference_background_color))));
71 | }
72 |
73 | @Override
74 | public void onItemClickImage(View view, int position, Integer currentColor, String name) {
75 | Intent intent = new Intent(getContext(), ColorSelectionActivity.class);
76 | startActivityForResult(intent, position);
77 | }
78 |
79 | @Override
80 | public void onItemClick(View view, int position, String name){}
81 |
82 |
83 | @Override
84 | public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
85 | if (resultCode== Activity.RESULT_OK) {
86 | switch (requestCode) {
87 | case 0:
88 | settingsManager.integerHashmap.put(getResources().getString(R.string.preference_background_color), data.getIntExtra("newColor", Color.parseColor("#000000")));
89 | generateColorOptions();
90 | adapterMI.notifyDataSetChanged();
91 | break;
92 | default:
93 | break;
94 | }
95 | }
96 | }
97 | }
98 |
99 |
100 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
20 |
23 |
24 |
28 |
31 |
34 |
37 |
42 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Twelveish - Watch face for Wear OS (Android Wear)
2 |
3 |
4 |
5 | Twelveish is a unique Wear OS (Android Wear) Watch Face that displays the **approximate time in words** (in multiple languages). It also shows the exact time (digital clock) and day of the week on the top, date and battery percentage slightly below, a complication on the bottom (on all Wear OS versions and Android Wear versions 2.0 and greater). On top of that, Twelveish is **extremely customizable, completely free and open-source**.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | ### [Download on the Google Play store](https://play.google.com/store/apps/details?id=com.layoutxml.twelveish).
14 |
15 | ## Foreword
16 |
17 | Project was started before learning any best practises or gaining experiance through work or studies and was intended to gain this experience. There are many things I would change and refactor if I were to start this project again. For now, it stays as a reminder of where it all started.
18 |
19 | ## Features
20 |
21 | In addition to what has been mentioned in the description above, Twelveish offers:
22 |
23 | * Over 30 background colors to choose from
24 | * Over 30 main and secondary colors both for active mode and ambient
25 | * 3 complications (2 round, 1 long or round)
26 | * Option to disable tapping on complications - useful if you constantly open them by accident
27 | * 16 different date format combinations
28 | * 5 capitalization options
29 | * 12 and 24 hour digital and word clock formats
30 | * show/hide almost any info (digital and word clocks, date, battery percentage, complication) with different combinations both for active and ambient modes
31 | * 14 languages (Dutch, English, Finnish, French, German, Greek, Hungarian, Italian, Lithuanian, Norwegian, Portuguese, Russian, Spanish and Swedish)
32 | * 11 fonts that are compatible with all languages
33 | * Wear OS (Android Wear) 1.5 and above support
34 | * Chin (flat tire) support
35 | * Square screen support
36 |
37 | Most of the settings above can be set to be different for active and ambient modes, making your watch face even more unique.
38 |
39 | ## Installation
40 |
41 | You can install Twelveish directly from your computer. Method below describes how to run Twelveish directly from the code and not how to sideload already precompiled .apk file. Instructions assume your watch (or phone) is connected to your computer (either via USB, Wi-Fi, Bluetooth or else). You can always install Twelveish directly from your watch (Wear OS and Android Wear version 2.0 and greater) or by installing companion app on your phone first. [Download on the Google Play store](https://play.google.com/store/apps/details?id=com.layoutxml.twelveish).
42 |
43 | ### Prerequisites
44 |
45 | * Android SDK v28
46 | * Latest Android Build Tools
47 | * Android Support Repository
48 | * Latest Android Studio (recommended) or other IDE
49 | * Developer options and ADB debugging enabled
50 |
51 | ### Installing
52 |
53 | 1. Download the source code or clone the repository.
54 | 2. Open Android Studio and choose "Open an Existing Android Studio Project".
55 | 3. Choose module "app" for Watch Face or "phone" for a companion app.
56 | 4. Click the Run button.
57 |
58 | ## Versioning
59 |
60 | From version 1.1.1 upwards, Twelveish versioning follows this scheme:
61 |
62 | * Version code: number of commits to this repository.
63 |
64 | * Version name: x.y.z, where z increases by 1 with at least one fix compared to the previous version, y increases by 1 with at least one new feature. y and x additionally increase by 1 if the number after it reaches 10. In that case the number that reaches 10 reverts back to 0.
65 |
66 | Versions 1.0.0-1.0.5 followed this scheme:
67 |
68 | * Version code: number of commits to this repository
69 |
70 | * Version name: 1.0.x, where x is the release number -1.
71 |
72 | Phone/companion app (module "phone") follows the same versioning except that the version code is always smaller by 1.
73 |
74 | ## Privacy policy
75 |
76 | Twelveish does not send any anonymous or personally identifiable information - Twelveish does not have an internet permission. Twelveish may locally store complication data to display it on the watch face which Twelveish does not have any control over. This information is not send anywhere else and may be deleted in the OS settings (by pressing "Clear data").
77 |
78 | ## Author
79 |
80 | More information about me and my projects: https://rokasjankunas.com
81 |
82 | ## Acknowledgments
83 |
84 | Logo: [@elawhatson](https://github.com/elawhatson)
85 |
86 | Translations:
87 |
88 | * Dutch: eelcovb [@m3ssage](https://github.com/m3ssage)
89 |
90 | * Finnish: Lari Palander [@oh2fhf](https://github.com/oh2fhf)
91 |
92 | * French: Kyl12
93 |
94 | * German: Robin Roschlau [@roschlau](https://github.com/roschlau)
95 |
96 | * Greek: Lefteris Popoff
97 |
98 | * Hungarian: Richard Hriech [@richardSin501](https://github.com/richardSin501)
99 |
100 | * Italian: Luigi Violin
101 |
102 | * Norwegian: Johnny Wiig
103 |
104 | * Portuguese: Emanuel Teixeira
105 |
106 | * Spanish: David Amian Valle [@amian84](https://github.com/amian84)
107 |
108 | * Spanish (improvement): Marco Martinez
109 |
110 | * Swedish: Max Sonneby [@StoreMax](https://github.com/StoreMax)
111 |
112 | ## License
113 |
114 | Twelveish is licensed under "GNU GPLv3" license. Copyright laws apply.
115 |
116 | Copyright © 2018 Rokas Jankūnas (LayoutXML)
117 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/activities/list_activities/IntegerTextViewOptionsActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018. LayoutXML
3 | * Created by LayoutXML.
4 | *
5 | */
6 |
7 | package com.layoutxml.twelveish.activities.list_activities;
8 |
9 | import android.app.Activity;
10 | import android.content.Context;
11 | import android.content.SharedPreferences;
12 | import android.os.Bundle;
13 | import androidx.annotation.NonNull;
14 | import androidx.recyclerview.widget.DefaultItemAnimator;
15 | import androidx.recyclerview.widget.RecyclerView;
16 | import androidx.wear.widget.WearableLinearLayoutManager;
17 | import androidx.wear.widget.WearableRecyclerView;
18 | import android.view.LayoutInflater;
19 | import android.view.View;
20 | import android.view.ViewGroup;
21 | import android.widget.TextView;
22 | import android.widget.Toast;
23 |
24 | import com.layoutxml.twelveish.R;
25 | import com.layoutxml.twelveish.objects.IntegerOption;
26 |
27 | import java.util.ArrayList;
28 | import java.util.List;
29 |
30 | public class IntegerTextViewOptionsActivity extends Activity {
31 |
32 | private List values = new ArrayList<>();
33 | private CapitalisationAdapter mAdapter;
34 | private SharedPreferences prefs;
35 | private String preferencesKey;
36 |
37 | @Override
38 | public void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | setContentView(R.layout.wearablerecyclerview_activity);
41 |
42 | prefs = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
43 |
44 | WearableRecyclerView mWearableRecyclerView = findViewById(R.id.wearable_recycler_view);
45 | mWearableRecyclerView.setLayoutManager(new WearableLinearLayoutManager(this));
46 | mWearableRecyclerView.setEdgeItemsCenteringEnabled(true);
47 |
48 | mAdapter = new CapitalisationAdapter();
49 | mWearableRecyclerView.setItemAnimator(new DefaultItemAnimator());
50 | mWearableRecyclerView.setAdapter(mAdapter);
51 |
52 | if (getIntent().getStringExtra("Activity").equals("Capitalization")) {
53 | generateCapitalizationValues();
54 | preferencesKey = getString(R.string.preference_capitalisation);
55 | }
56 | else if (getIntent().getStringExtra("Activity").equals("DateOrder")) {
57 | generateDateOrderValues();
58 | preferencesKey = getString(R.string.preference_date_order);
59 | }
60 | }
61 |
62 | private void generateCapitalizationValues(){
63 | IntegerOption capitalisation = new IntegerOption();
64 | capitalisation.setName("All words title case");
65 | capitalisation.setInteger(0);
66 | values.add(capitalisation);
67 |
68 | capitalisation = new IntegerOption();
69 | capitalisation.setName("All uppercase");
70 | capitalisation.setInteger(1);
71 | values.add(capitalisation);
72 |
73 | capitalisation = new IntegerOption();
74 | capitalisation.setName("All lowercase");
75 | capitalisation.setInteger(2);
76 | values.add(capitalisation);
77 |
78 | capitalisation = new IntegerOption();
79 | capitalisation.setName("First word title case");
80 | capitalisation.setInteger(3);
81 | values.add(capitalisation);
82 |
83 | capitalisation = new IntegerOption();
84 | capitalisation.setName("First word in every\nline title case");
85 | capitalisation.setInteger(4);
86 | values.add(capitalisation);
87 |
88 | mAdapter.notifyDataSetChanged();
89 | }
90 |
91 | private void generateDateOrderValues() {
92 | IntegerOption dateOrder = new IntegerOption();
93 | dateOrder.setName("MDY");
94 | dateOrder.setInteger(0);
95 | values.add(dateOrder);
96 |
97 | dateOrder = new IntegerOption();
98 | dateOrder.setName("DMY");
99 | dateOrder.setInteger(1);
100 | values.add(dateOrder);
101 |
102 | dateOrder = new IntegerOption();
103 | dateOrder.setName("YMD");
104 | dateOrder.setInteger(2);
105 | values.add(dateOrder);
106 |
107 | dateOrder = new IntegerOption();
108 | dateOrder.setName("YDM");
109 | dateOrder.setInteger(3);
110 | values.add(dateOrder);
111 | }
112 |
113 | public class CapitalisationAdapter extends RecyclerView.Adapter{
114 |
115 | class MyViewHolder extends RecyclerView.ViewHolder {
116 |
117 | TextView name;
118 |
119 | MyViewHolder(View view) {
120 | super(view);
121 | name = view.findViewById(R.id.dateoptionslistListTextView);
122 |
123 | view.setOnClickListener(new View.OnClickListener() {
124 | @Override
125 | public void onClick(View v) {
126 | int position = getAdapterPosition(); // gets item position
127 | prefs.edit().putInt(preferencesKey,values.get(position).getInteger()).apply();
128 | Toast.makeText(getApplicationContext(), "Preference set", Toast.LENGTH_SHORT).show();
129 | finish();
130 | }
131 | });
132 | }
133 | }
134 |
135 | @NonNull
136 | @Override
137 | public CapitalisationAdapter.MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
138 | View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.textview_item,parent,false);
139 | return new CapitalisationAdapter.MyViewHolder(itemView);
140 | }
141 |
142 | @Override
143 | public void onBindViewHolder(@NonNull CapitalisationAdapter.MyViewHolder holder, int position) {
144 | IntegerOption capitalisation = values.get(position);
145 | holder.name.setText(capitalisation.getName());
146 | }
147 |
148 | @Override
149 | public int getItemCount() {
150 | return values.size();
151 | }
152 | }
153 |
154 | }
155 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/activities/list_activities/ActivityTextViewActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018. LayoutXML
3 | * Created by LayoutXML.
4 | *
5 | */
6 |
7 | package com.layoutxml.twelveish.activities.list_activities;
8 |
9 | import android.app.Activity;
10 | import android.content.Intent;
11 | import android.os.Bundle;
12 | import androidx.annotation.NonNull;
13 | import androidx.recyclerview.widget.DefaultItemAnimator;
14 | import androidx.recyclerview.widget.RecyclerView;
15 | import androidx.wear.widget.WearableLinearLayoutManager;
16 | import androidx.wear.widget.WearableRecyclerView;
17 | import android.view.LayoutInflater;
18 | import android.view.View;
19 | import android.view.ViewGroup;
20 | import android.widget.TextView;
21 |
22 | import com.layoutxml.twelveish.R;
23 | import com.layoutxml.twelveish.objects.ActivityOption;
24 |
25 | import java.util.ArrayList;
26 | import java.util.List;
27 |
28 | public class ActivityTextViewActivity extends Activity{
29 |
30 | private List values = new ArrayList<>();
31 | private ColorOptionsListAdapter mAdapter;
32 |
33 | @Override
34 | public void onCreate(Bundle savedInstanceState) {
35 | super.onCreate(savedInstanceState);
36 | setContentView(R.layout.wearablerecyclerview_activity);
37 |
38 | WearableRecyclerView mWearableRecyclerView = findViewById(R.id.wearable_recycler_view);
39 | mWearableRecyclerView.setLayoutManager(new WearableLinearLayoutManager(this));
40 | mWearableRecyclerView.setEdgeItemsCenteringEnabled(true);
41 |
42 | mAdapter = new ColorOptionsListAdapter();
43 | mWearableRecyclerView.setItemAnimator(new DefaultItemAnimator());
44 | mWearableRecyclerView.setAdapter(mAdapter);
45 |
46 | if (getIntent().getStringExtra("Activity").equals("ColorOptionsList"))
47 | generateColorOptionsListValues();
48 | else if (getIntent().getStringExtra("Activity").equals("DateOptionsList"))
49 | generateDateOptionsListValues();
50 | }
51 |
52 | private void generateColorOptionsListValues(){
53 | ActivityOption dateOption = new ActivityOption();
54 | dateOption.setName("Main text (active)");
55 | dateOption.setActivity(IntegerImageViewActivity.class);
56 | dateOption.setExtra("TextColor");
57 | dateOption.setExtra2(getString(R.string.preference_main_color));
58 | values.add(dateOption);
59 |
60 | dateOption = new ActivityOption();
61 | dateOption.setName("Main text (ambient)");
62 | dateOption.setActivity(IntegerImageViewActivity.class);
63 | dateOption.setExtra("TextColor");
64 | dateOption.setExtra2(getString(R.string.preference_main_color_ambient));
65 | values.add(dateOption);
66 |
67 | dateOption = new ActivityOption();
68 | dateOption.setName("Secondary text (active)");
69 | dateOption.setActivity(IntegerImageViewActivity.class);
70 | dateOption.setExtra("TextColor");
71 | dateOption.setExtra2(getString(R.string.preference_secondary_color));
72 | values.add(dateOption);
73 |
74 | dateOption = new ActivityOption();
75 | dateOption.setName("Secondary text (ambient)");
76 | dateOption.setActivity(IntegerImageViewActivity.class);
77 | dateOption.setExtra("TextColor");
78 | dateOption.setExtra2(getString(R.string.preference_secondary_color_ambient));
79 | values.add(dateOption);
80 |
81 | dateOption = new ActivityOption();
82 | dateOption.setName("Background (active)");
83 | dateOption.setActivity(IntegerImageViewActivity.class);
84 | dateOption.setExtra("BackgroundColor");
85 | dateOption.setExtra2(getString(R.string.preference_background_color));
86 | values.add(dateOption);
87 |
88 | mAdapter.notifyDataSetChanged();
89 | }
90 |
91 | private void generateDateOptionsListValues(){
92 | ActivityOption dateOption = new ActivityOption();
93 | dateOption.setName("Date order");
94 | dateOption.setActivity(IntegerTextViewOptionsActivity.class);
95 | dateOption.setExtra("DateOrder");
96 | values.add(dateOption);
97 |
98 | dateOption = new ActivityOption();
99 | dateOption.setName("Separator symbol");
100 | dateOption.setActivity(StringTextViewActivity.class);
101 | dateOption.setExtra("DateSeparator");
102 | values.add(dateOption);
103 |
104 | mAdapter.notifyDataSetChanged();
105 | }
106 |
107 | public class ColorOptionsListAdapter extends RecyclerView.Adapter{
108 |
109 | class MyViewHolder extends RecyclerView.ViewHolder {
110 |
111 | TextView name;
112 |
113 | MyViewHolder(View view) {
114 | super(view);
115 | name = view.findViewById(R.id.dateoptionslistListTextView);
116 |
117 | view.setOnClickListener(new View.OnClickListener() {
118 | @Override
119 | public void onClick(View v) {
120 | int position = getAdapterPosition(); // gets item position
121 | Intent intent = new Intent(ActivityTextViewActivity.this, values.get(position).getActivity());
122 | intent.putExtra("Activity",values.get(position).getExtra());
123 | intent.putExtra("SettingsValue",values.get(position).getExtra2());
124 | ActivityTextViewActivity.this.startActivity(intent);
125 | }
126 | });
127 | }
128 |
129 | }
130 |
131 | @NonNull
132 | @Override
133 | public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
134 | View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.textview_item,parent,false);
135 | return new MyViewHolder(itemView);
136 | }
137 |
138 | @Override
139 | public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
140 | ActivityOption colorOption = values.get(position);
141 | holder.name.setText(colorOption.getName());
142 |
143 | }
144 |
145 | @Override
146 | public int getItemCount() {
147 | return values.size();
148 | }
149 |
150 | }
151 |
152 | }
153 |
--------------------------------------------------------------------------------
/phone/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
16 |
21 |
26 |
31 |
36 |
41 |
46 |
51 |
56 |
61 |
66 |
71 |
76 |
81 |
86 |
91 |
96 |
101 |
106 |
111 |
116 |
121 |
126 |
131 |
136 |
141 |
146 |
151 |
156 |
161 |
166 |
171 |
176 |
177 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/fragments/MainTextSettingsFragment.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.fragments;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.graphics.Color;
6 | import android.os.Bundle;
7 | import android.util.Log;
8 | import android.util.Pair;
9 | import android.view.LayoutInflater;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 |
13 | import androidx.annotation.NonNull;
14 | import androidx.annotation.Nullable;
15 | import androidx.fragment.app.Fragment;
16 | import androidx.recyclerview.widget.LinearLayoutManager;
17 | import androidx.recyclerview.widget.RecyclerView;
18 |
19 | import com.layoutxml.twelveish.CustomizationScreen;
20 | import com.layoutxml.twelveish.R;
21 | import com.layoutxml.twelveish.SettingsManager;
22 | import com.layoutxml.twelveish.activities.AboutActivityP;
23 | import com.layoutxml.twelveish.activities.ColorSelectionActivity;
24 | import com.layoutxml.twelveish.adapters.ImageRecyclerViewAdapter;
25 | import com.layoutxml.twelveish.adapters.SwitchRecyclerViewAdapter;
26 | import com.layoutxml.twelveish.adapters.TextviewRecyclerViewAdapter;
27 |
28 | import java.util.ArrayList;
29 | import java.util.List;
30 |
31 | public class MainTextSettingsFragment extends Fragment implements ImageRecyclerViewAdapter.ItemClickImageListener, TextviewRecyclerViewAdapter.ItemClickListener, SwitchRecyclerViewAdapter.ItemClickSwitchListener{
32 |
33 | private ImageRecyclerViewAdapter adapterMI;
34 | private TextviewRecyclerViewAdapter adapterMT;
35 | private SwitchRecyclerViewAdapter adapterMS;
36 | private final String settingsMIName = "settingsMI";
37 | private final String settingsMTName = "settingsMT";
38 | private final String settingsMSName = "settingsMS";
39 | private SettingsManager settingsManager;
40 | private CustomizationScreen activity;
41 | private List> optionsTI;
42 | private static final String TAG = "MainTextSettingsFragmen";
43 |
44 | @Nullable
45 | @Override
46 | public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
47 | View view = inflater.inflate(R.layout.top_settings_fragment,container,false);
48 |
49 | activity = (CustomizationScreen) getContext();
50 | settingsManager = activity.getSettingsManagerComponent().getSettingsManager();
51 |
52 | optionsTI = new ArrayList<>();
53 | generateColorOptions();
54 |
55 | List> optionsTT = new ArrayList<>();
56 | optionsTT.add(new Pair("Font","Currently set "+settingsManager.stringHashmap.get(getResources().getString(R.string.preference_font))));
57 | optionsTT.add(new Pair("Capitalization","Currently set "+settingsManager.integerHashmap.get(getResources().getString(R.string.preference_capitalisation))));
58 | optionsTT.add(new Pair("Text Size Offset","Currently set "+settingsManager.integerHashmap.get(getResources().getString(R.string.main_text_size_offset))));
59 |
60 | List> optionsTS = new ArrayList<>();
61 | optionsTS.add(new Pair("24h Format",getResources().getString(R.string.preference_military_text_time)));
62 |
63 | RecyclerView recyclerViewTI = view.findViewById(R.id.topImageRV);
64 | recyclerViewTI.setLayoutManager(new LinearLayoutManager(getContext()));
65 | adapterMI = new ImageRecyclerViewAdapter(getContext(),optionsTI, settingsMIName);
66 | adapterMI.setClickListener(this);
67 | recyclerViewTI.setAdapter(adapterMI);
68 |
69 | RecyclerView recyclerViewTT = view.findViewById(R.id.topTextRV);
70 | recyclerViewTT.setLayoutManager(new LinearLayoutManager(getContext()));
71 | adapterMT = new TextviewRecyclerViewAdapter(getContext(),optionsTT, settingsMTName);
72 | adapterMT.setClickListener(this);
73 | recyclerViewTT.setAdapter(adapterMT);
74 |
75 | RecyclerView recyclerViewTS = view.findViewById(R.id.topSwitchRV);
76 | recyclerViewTS.setLayoutManager(new LinearLayoutManager(getContext()));
77 | adapterMS = new SwitchRecyclerViewAdapter(getContext(),optionsTS, settingsMSName, settingsManager);
78 | adapterMS.setClickListener(this);
79 | recyclerViewTS.setAdapter(adapterMS);
80 |
81 | return view;
82 | }
83 |
84 | private void generateColorOptions() {
85 | optionsTI.clear();
86 | optionsTI.add(new Pair("Text Color",settingsManager.integerHashmap.get(getResources().getString(R.string.preference_main_text_color))));
87 | optionsTI.add(new Pair("Text Color in Ambient",settingsManager.integerHashmap.get(getResources().getString(R.string.preference_main_text_color_ambient))));
88 | }
89 |
90 | @Override
91 | public void onItemClickSwitch(View view, int position, boolean newValue, String name) {
92 | if (name.equals(settingsMSName)) {
93 | activity.invalidatePreview();
94 | }
95 | }
96 |
97 | @Override
98 | public void onItemClickImage(View view, int position, Integer currentColor, String name) {
99 | Intent intent = new Intent(getContext(), ColorSelectionActivity.class);
100 | startActivityForResult(intent, position);
101 | }
102 |
103 | @Override
104 | public void onItemClick(View view, int position, String name){
105 | }
106 |
107 | @Override
108 | public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
109 | Log.d(TAG, "onActivityResult: result received");
110 | if (resultCode==Activity.RESULT_OK) {
111 | Log.d(TAG, "onActivityResult: result is for "+requestCode);
112 | switch (requestCode) {
113 | case 0:
114 | settingsManager.integerHashmap.put(getResources().getString(R.string.preference_main_text_color), data.getIntExtra("newColor", Color.parseColor("#000000")));
115 | generateColorOptions();
116 | adapterMI.notifyDataSetChanged();
117 | break;
118 | case 1:
119 | settingsManager.integerHashmap.put(getResources().getString(R.string.preference_main_text_color_ambient), data.getIntExtra("newColor", Color.parseColor("#000000")));
120 | generateColorOptions();
121 | adapterMI.notifyDataSetChanged();
122 | break;
123 | default:
124 | break;
125 | }
126 | }
127 | }
128 | }
129 |
130 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/activities/list_activities/FontTextViewActivity.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.activities.list_activities;
2 |
3 | import android.app.Activity;
4 | import android.content.Context;
5 | import android.content.SharedPreferences;
6 | import android.graphics.Typeface;
7 | import android.os.Bundle;
8 | import androidx.annotation.NonNull;
9 | import androidx.core.content.res.ResourcesCompat;
10 | import androidx.recyclerview.widget.DefaultItemAnimator;
11 | import androidx.recyclerview.widget.RecyclerView;
12 | import androidx.wear.widget.WearableLinearLayoutManager;
13 | import androidx.wear.widget.WearableRecyclerView;
14 | import android.view.LayoutInflater;
15 | import android.view.View;
16 | import android.view.ViewGroup;
17 | import android.widget.TextView;
18 | import android.widget.Toast;
19 |
20 | import com.layoutxml.twelveish.R;
21 | import com.layoutxml.twelveish.objects.FontOption;
22 |
23 | import java.util.ArrayList;
24 | import java.util.List;
25 |
26 | public class FontTextViewActivity extends Activity{
27 |
28 | private List values = new ArrayList<>();
29 | private FontOptionsListAdapter mAdapter;
30 | private SharedPreferences prefs;
31 |
32 | @Override
33 | public void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.wearablerecyclerview_activity);
36 |
37 | prefs = this.getSharedPreferences(getString(R.string.preference_file_key), Context.MODE_PRIVATE);
38 |
39 | WearableRecyclerView mWearableRecyclerView = findViewById(R.id.wearable_recycler_view);
40 | mWearableRecyclerView.setLayoutManager(new WearableLinearLayoutManager(this));
41 | mWearableRecyclerView.setEdgeItemsCenteringEnabled(true);
42 |
43 | mAdapter = new FontOptionsListAdapter();
44 | mWearableRecyclerView.setItemAnimator(new DefaultItemAnimator());
45 | mWearableRecyclerView.setAdapter(mAdapter);
46 | generateValues();
47 | }
48 |
49 | private void generateValues(){
50 | FontOption option = new FontOption();
51 | option.setName("Roboto light (default)");
52 | option.setKey("robotolight");
53 | option.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL));
54 | values.add(option);
55 |
56 | option = new FontOption();
57 | option.setName("Alegreya");
58 | option.setKey("alegreya");
59 | option.setTypeface(ResourcesCompat.getFont(this,R.font.alegreya));
60 | values.add(option);
61 |
62 | option = new FontOption();
63 | option.setName("Cabin");
64 | option.setKey("cabin");
65 | option.setTypeface(ResourcesCompat.getFont(this,R.font.cabin));
66 | values.add(option);
67 |
68 | option = new FontOption();
69 | option.setName("IBM Plex Sans");
70 | option.setKey("ibmplexsans");
71 | option.setTypeface(ResourcesCompat.getFont(this,R.font.ibmplexsans));
72 | values.add(option);
73 |
74 | option = new FontOption();
75 | option.setName("Inconsolata");
76 | option.setKey("inconsolata");
77 | option.setTypeface(ResourcesCompat.getFont(this,R.font.inconsolata));
78 | values.add(option);
79 |
80 | option = new FontOption();
81 | option.setName("Merriweather");
82 | option.setKey("merriweather");
83 | option.setTypeface(ResourcesCompat.getFont(this,R.font.merriweather));
84 | values.add(option);
85 |
86 | option = new FontOption();
87 | option.setName("Nunito");
88 | option.setKey("nunito");
89 | option.setTypeface(ResourcesCompat.getFont(this,R.font.nunito));
90 | values.add(option);
91 |
92 | option = new FontOption();
93 | option.setName("Pacifico");
94 | option.setKey("pacifico");
95 | option.setTypeface(ResourcesCompat.getFont(this,R.font.pacifico));
96 | values.add(option);
97 |
98 | option = new FontOption();
99 | option.setName("Quattrocento");
100 | option.setKey("quattrocento");
101 | option.setTypeface(ResourcesCompat.getFont(this,R.font.quattrocento));
102 | values.add(option);
103 |
104 | option = new FontOption();
105 | option.setName("Quicksand");
106 | option.setKey("quicksand");
107 | option.setTypeface(ResourcesCompat.getFont(this,R.font.quicksand));
108 | values.add(option);
109 |
110 | option = new FontOption();
111 | option.setName("Rubik");
112 | option.setKey("rubik");
113 | option.setTypeface(ResourcesCompat.getFont(this,R.font.rubik));
114 | values.add(option);
115 |
116 | mAdapter.notifyDataSetChanged();
117 | }
118 |
119 | public class FontOptionsListAdapter extends RecyclerView.Adapter{
120 |
121 | class MyViewHolder extends RecyclerView.ViewHolder {
122 |
123 | TextView name;
124 |
125 | MyViewHolder(View view) {
126 | super(view);
127 | name = view.findViewById(R.id.dateoptionslistListTextView);
128 |
129 | view.setOnClickListener(new View.OnClickListener() {
130 | @Override
131 | public void onClick(View v) {
132 | int position = getAdapterPosition(); // gets item position
133 | FontOption selectedMenuItem = values.get(position);
134 | prefs.edit().putString(getString(R.string.preference_font),selectedMenuItem.getKey()).apply();
135 | Toast.makeText(getApplicationContext(), "Preference set", Toast.LENGTH_SHORT).show();
136 | finish();
137 | }
138 | });
139 | }
140 |
141 | }
142 |
143 | @NonNull
144 | @Override
145 | public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
146 | View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.textview_item,parent,false);
147 | return new MyViewHolder(itemView);
148 | }
149 |
150 | @Override
151 | public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
152 | FontOption fontOption = values.get(position);
153 | holder.name.setText(fontOption.getName());
154 | holder.name.setTypeface(fontOption.getTypeface());
155 |
156 | }
157 |
158 | @Override
159 | public int getItemCount() {
160 | return values.size();
161 | }
162 |
163 | }
164 |
165 | }
166 |
--------------------------------------------------------------------------------
/phone/src/main/java/com/layoutxml/twelveish/activities/ColorSelectionActivity.java:
--------------------------------------------------------------------------------
1 | package com.layoutxml.twelveish.activities;
2 |
3 | import android.app.Activity;
4 | import android.content.Intent;
5 | import android.graphics.Color;
6 | import android.os.Bundle;
7 | import android.util.Log;
8 | import android.util.Pair;
9 | import android.view.View;
10 |
11 | import androidx.annotation.Nullable;
12 | import androidx.recyclerview.widget.LinearLayoutManager;
13 | import androidx.recyclerview.widget.RecyclerView;
14 |
15 | import com.layoutxml.twelveish.R;
16 | import com.layoutxml.twelveish.adapters.ImageRecyclerViewAdapter;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | public class ColorSelectionActivity extends Activity implements ImageRecyclerViewAdapter.ItemClickImageListener {
22 |
23 | private ImageRecyclerViewAdapter adapter;
24 | private String settingsName = "colorSelectionList";
25 | private List> colorOptions;
26 | private static final String TAG = "ColorSelectionActivity";
27 |
28 | @Override
29 | protected void onCreate(@Nullable Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.color_selection_activity);
32 |
33 | colorOptions = new ArrayList<>();
34 | //white-black
35 | colorOptions.add(new Pair("White", Color.parseColor("#ffffff")));
36 | colorOptions.add(new Pair("Gray 400", Color.parseColor("#bdbdbd")));
37 | colorOptions.add(new Pair("Gray 500", Color.parseColor("#9e9e9e")));
38 | colorOptions.add(new Pair("Material Blue Gray", Color.parseColor("#607D8B")));
39 | colorOptions.add(new Pair("Gray 600", Color.parseColor("#757575")));
40 | colorOptions.add(new Pair("Gray 700", Color.parseColor("#616161")));
41 | colorOptions.add(new Pair("Gray 800", Color.parseColor("#424242")));
42 | colorOptions.add(new Pair("Gray 900", Color.parseColor("#212121")));
43 | colorOptions.add(new Pair("Black", Color.parseColor("#000000")));
44 | colorOptions.add(new Pair("Material Red", Color.parseColor("#F44336")));
45 | colorOptions.add(new Pair("Vibrant Red", Color.parseColor("#FF1744")));
46 | colorOptions.add(new Pair("Red", Color.parseColor("#ff0000")));
47 | colorOptions.add(new Pair("Material Pink", Color.parseColor("#E91E63")));
48 | colorOptions.add(new Pair("Vibrant Pink", Color.parseColor("#F50057")));
49 | colorOptions.add(new Pair("Material Purple", Color.parseColor("#9C27B0")));
50 | colorOptions.add(new Pair("Vibrant Purple", Color.parseColor("#D500F9")));
51 | colorOptions.add(new Pair("Magenta", Color.parseColor("#ff00ff")));
52 | colorOptions.add(new Pair("Material Deep Purple", Color.parseColor("#673AB7")));
53 | colorOptions.add(new Pair("Vibrant Deep Purple", Color.parseColor("#651FFF")));
54 | colorOptions.add(new Pair("Material Indigo", Color.parseColor("#3F51B5")));
55 | colorOptions.add(new Pair("Vibrant Indigo", Color.parseColor("#3D5AFE")));
56 | colorOptions.add(new Pair("Blue", Color.parseColor("#0000ff")));
57 | colorOptions.add(new Pair("Material Blue", Color.parseColor("#2196F3")));
58 | colorOptions.add(new Pair("Vibrant Blue", Color.parseColor("#2979FF")));
59 | colorOptions.add(new Pair("Material Light Blue", Color.parseColor("#03A9F4")));
60 | colorOptions.add(new Pair("Vibrant Light Blue", Color.parseColor("#00B0FF")));
61 | colorOptions.add(new Pair("Material Cyan", Color.parseColor("#00BCD4")));
62 | colorOptions.add(new Pair("Vibrant Cyan", Color.parseColor("#00E5FF")));
63 | colorOptions.add(new Pair("Cyan", Color.parseColor("#00ffff")));
64 | colorOptions.add(new Pair("Material Teal", Color.parseColor("#009688")));
65 | colorOptions.add(new Pair("Vibrant Teal", Color.parseColor("#1DE9B6")));
66 | colorOptions.add(new Pair("Material Green", Color.parseColor("#4CAF50")));
67 | colorOptions.add(new Pair("Vibrant Green", Color.parseColor("#00E676")));
68 | colorOptions.add(new Pair("Green", Color.parseColor("#00ff00")));
69 | colorOptions.add(new Pair("Material Light Green", Color.parseColor("#8BC34A")));
70 | colorOptions.add(new Pair("Vibrant Light Green", Color.parseColor("#76FF03")));
71 | colorOptions.add(new Pair("Material Lime", Color.parseColor("#CDDC39")));
72 | colorOptions.add(new Pair("Vibrant Lime", Color.parseColor("#C6FF00")));
73 | colorOptions.add(new Pair("Yellow", Color.parseColor("#ffff00")));
74 | colorOptions.add(new Pair("Material Yellow", Color.parseColor("#FFEB3B")));
75 | colorOptions.add(new Pair("Vibrant Yellow", Color.parseColor("#FFEA00")));
76 | colorOptions.add(new Pair("Material Amber", Color.parseColor("#FFC107")));
77 | colorOptions.add(new Pair("Vibrant Amber", Color.parseColor("#FFC400")));
78 | colorOptions.add(new Pair("Material Orange", Color.parseColor("#FF9800")));
79 | colorOptions.add(new Pair("Vibrant Orange", Color.parseColor("#FF9100")));
80 | colorOptions.add(new Pair("Material Deep Orange", Color.parseColor("#FF5722")));
81 | colorOptions.add(new Pair("Vibrant Deep Orange", Color.parseColor("#FF3D00")));
82 | colorOptions.add(new Pair("Material Brown", Color.parseColor("#795548")));
83 |
84 | RecyclerView recyclerView = findViewById(R.id.colorList);
85 | recyclerView.setLayoutManager(new LinearLayoutManager(this));
86 | adapter = new ImageRecyclerViewAdapter(this,colorOptions, settingsName);
87 | adapter.setClickListener(this);
88 | recyclerView.setAdapter(adapter);
89 | }
90 |
91 | @Override
92 | public void onItemClickImage(View view, int position, Integer currentColor, String name) {
93 | Intent returnIntent = new Intent();
94 | returnIntent.putExtra("newColor",currentColor);
95 | setResult(Activity.RESULT_OK,returnIntent);
96 | Log.d(TAG, "onItemClickImage: result set");
97 | finish();
98 | }
99 |
100 | @Override
101 | protected void onDestroy() {
102 | super.onDestroy();
103 | Intent returnIntent = new Intent();
104 | setResult(Activity.RESULT_CANCELED, returnIntent);
105 | finish();
106 | }
107 | }
108 |
--------------------------------------------------------------------------------
/app/src/main/java/com/layoutxml/twelveish/activities/list_activities/ActivityImageViewActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2018. LayoutXML
3 | * Created by LayoutXML.
4 | *
5 | */
6 |
7 | package com.layoutxml.twelveish.activities.list_activities;
8 |
9 | import android.app.Activity;
10 | import android.content.Intent;
11 | import android.os.Build;
12 | import android.os.Bundle;
13 | import androidx.annotation.NonNull;
14 | import androidx.recyclerview.widget.DefaultItemAnimator;
15 | import androidx.recyclerview.widget.RecyclerView;
16 | import androidx.wear.widget.WearableLinearLayoutManager;
17 | import androidx.wear.widget.WearableRecyclerView;
18 | import android.view.LayoutInflater;
19 | import android.view.View;
20 | import android.view.ViewGroup;
21 | import android.widget.ImageView;
22 | import android.widget.TextView;
23 |
24 | import com.layoutxml.twelveish.R;
25 | import com.layoutxml.twelveish.activities.AboutActivity;
26 | import com.layoutxml.twelveish.activities.FontSizeInfoActivity;
27 | import com.layoutxml.twelveish.config.ComplicationConfigActivity;
28 | import com.layoutxml.twelveish.objects.ActivityOption;
29 |
30 | import java.util.ArrayList;
31 | import java.util.List;
32 |
33 | public class ActivityImageViewActivity extends Activity {
34 |
35 | private List values = new ArrayList<>();
36 | private SettingsAdapter mAdapter;
37 |
38 | @Override
39 | public void onCreate(Bundle savedInstanceState) {
40 | super.onCreate(savedInstanceState);
41 | setContentView(R.layout.wearablerecyclerview_activity);
42 |
43 | WearableRecyclerView mWearableRecyclerView = findViewById(R.id.wearable_recycler_view);
44 | mWearableRecyclerView.setLayoutManager(new WearableLinearLayoutManager(this));
45 | mWearableRecyclerView.setEdgeItemsCenteringEnabled(true);
46 |
47 | mAdapter = new SettingsAdapter();
48 | mWearableRecyclerView.setItemAnimator(new DefaultItemAnimator());
49 | mWearableRecyclerView.setAdapter(mAdapter);
50 | generateValues();
51 | }
52 |
53 | private void generateValues(){
54 | ActivityOption activityOption = new ActivityOption();
55 | if (android.os.Build.VERSION.SDK_INT>= Build.VERSION_CODES.N) {
56 | activityOption.setName("Complication");
57 | activityOption.setIcon(R.drawable.ic_complicationp);
58 | activityOption.setActivity(ComplicationConfigActivity.class);
59 | values.add(activityOption);
60 | }
61 |
62 | activityOption = new ActivityOption();
63 | activityOption.setName("Colors");
64 | activityOption.setIcon(R.drawable.ic_colorp);
65 | activityOption.setActivity(ActivityTextViewActivity.class);
66 | activityOption.setExtra("ColorOptionsList");
67 | values.add(activityOption);
68 |
69 | activityOption = new ActivityOption();
70 | activityOption.setName("Font");
71 | activityOption.setIcon(R.drawable.ic_fontp);
72 | activityOption.setActivity(FontTextViewActivity.class);
73 | values.add(activityOption);
74 |
75 | activityOption = new ActivityOption();
76 | activityOption.setName("Date format");
77 | activityOption.setIcon(R.drawable.ic_datep);
78 | activityOption.setActivity(ActivityTextViewActivity.class);
79 | activityOption.setExtra("DateOptionsList");
80 | values.add(activityOption);
81 |
82 | activityOption = new ActivityOption();
83 | activityOption.setName("Capitalisation");
84 | activityOption.setIcon(R.drawable.ic_capitalisationp);
85 | activityOption.setActivity(IntegerTextViewOptionsActivity.class);
86 | activityOption.setExtra("Capitalization");
87 | values.add(activityOption);
88 |
89 | activityOption = new ActivityOption();
90 | activityOption.setName("Show/hide elements");
91 | activityOption.setIcon(R.drawable.ic_showhidep);
92 | activityOption.setActivity(BooleanSwitcherActivity.class);
93 | activityOption.setExtra("ShowHide");
94 | values.add(activityOption);
95 |
96 | activityOption = new ActivityOption();
97 | activityOption.setName("Language");
98 | activityOption.setIcon(R.drawable.ic_languagep);
99 | activityOption.setActivity(StringTextViewActivity.class);
100 | activityOption.setExtra("Language");
101 | values.add(activityOption);
102 |
103 | activityOption = new ActivityOption();
104 | activityOption.setName("Text size offset");
105 | activityOption.setIcon(R.drawable.ic_capitalisationp);
106 | activityOption.setActivity(FontSizeInfoActivity.class);
107 | activityOption.setExtra("TextSize");
108 | values.add(activityOption);
109 |
110 | activityOption = new ActivityOption();
111 | activityOption.setName("Miscellaneous");
112 | activityOption.setIcon(R.drawable.ic_miscp);
113 | activityOption.setActivity(BooleanSwitcherActivity.class);
114 | activityOption.setExtra("MiscOptions");
115 | values.add(activityOption);
116 |
117 | activityOption = new ActivityOption();
118 | activityOption.setName("Info");
119 | activityOption.setIcon(R.drawable.ic_infop);
120 | activityOption.setActivity(AboutActivity.class);
121 | values.add(activityOption);
122 |
123 | mAdapter.notifyDataSetChanged();
124 | }
125 |
126 | public class SettingsAdapter extends RecyclerView.Adapter{
127 |
128 | class MyViewHolder extends RecyclerView.ViewHolder {
129 |
130 | TextView name;
131 | ImageView icon;
132 |
133 | MyViewHolder(View view) {
134 | super(view);
135 | name = view.findViewById(R.id.settingsListTextView);
136 | icon = view.findViewById(R.id.settingsListImagetView);
137 |
138 | view.setOnClickListener(new View.OnClickListener() {
139 | @Override
140 | public void onClick(View v) {
141 | int position = getAdapterPosition(); // gets item position
142 | Intent intent;
143 | intent = new Intent(ActivityImageViewActivity.this, values.get(position).getActivity());
144 | intent.putExtra("Activity",values.get(position).getExtra());
145 | ActivityImageViewActivity.this.startActivity(intent);
146 | }
147 | });
148 | }
149 | }
150 |
151 | @NonNull
152 | @Override
153 | public MyViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
154 | View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.imageview_and_textview_item,parent,false);
155 | return new MyViewHolder(itemView);
156 | }
157 |
158 | @Override
159 | public void onBindViewHolder(@NonNull MyViewHolder holder, int position) {
160 | ActivityOption activityOption = values.get(position);
161 | holder.name.setText(activityOption.getName());
162 | holder.icon.setImageResource(activityOption.getIcon());
163 |
164 | }
165 |
166 | @Override
167 | public int getItemCount() {
168 | return values.size();
169 | }
170 | }
171 |
172 | }
--------------------------------------------------------------------------------