diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 00000000..d53af97b --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,53 @@ +# Use Docker file from https://hub.docker.com/r/runmymind/docker-android-sdk +# Last docker plugin version can be found here: +# https://github.com/buildkite-plugins/docker-buildkite-plugin/releases + +# Build debug version of the RiotX application, from the develop branch and the features branches + +steps: + - label: "Assemble GPlay Debug version" + agents: + # We use a medium sized instance instead of the normal small ones because + # gradle build is long + queue: "medium" + commands: + - "./gradlew clean lintGplayRelease assembleGplayDebug --stacktrace" + artifact_paths: + - "vector/build/outputs/apk/gplay/debug/*.apk" + branches: "!master" + plugins: + - docker#v3.1.0: + image: "runmymind/docker-android-sdk" + + - label: "Assemble FDroid Debug version" + agents: + # We use a medium sized instance instead of the normal small ones because + # gradle build is long + queue: "medium" + commands: + - "./gradlew clean lintFdroidRelease assembleFdroidDebug --stacktrace" + artifact_paths: + - "vector/build/outputs/apk/fdroid/debug/*.apk" + branches: "!master" + plugins: + - docker#v3.1.0: + image: "runmymind/docker-android-sdk" + + - label: "Build Google Play unsigned APK" + agents: + # We use a medium sized instance instead of the normal small ones because + # gradle build is long + queue: "medium" + commands: + - "./gradlew clean assembleGplayRelease --stacktrace" + artifact_paths: + - "vector/build/outputs/apk/gplay/release/*.apk" + branches: "master" + plugins: + - docker#v3.1.0: + image: "runmymind/docker-android-sdk" + + # Code quality + + - label: "Code quality" + command: "./tools/check/check_code_quality.sh" diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..01cdae74 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,10 @@ +### Pull Request Checklist + + + +- [ ] Changes has been tested on an Android device or Android emulator with API 16 +- [ ] UI change has been tested on both light and dark themes +- [ ] Pull request is based on the develop branch +- [ ] Pull request updates [CHANGES.md](https://github.com/vector-im/riotX-android/blob/develop/CHANGES.md) +- [ ] Pull request includes screenshots or videos if containing UI changes +- [ ] Pull request includes a [sign off](https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst#sign-off) diff --git a/.gitignore b/.gitignore index 5edb4eeb..07221107 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ *.iml .gradle /local.properties +.idea/* +/.idea/* /.idea/libraries /.idea/modules.xml /.idea/workspace.xml @@ -8,3 +10,5 @@ /build /captures .externalNativeBuild + +/tmp diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser deleted file mode 100644 index 8636578c..00000000 Binary files a/.idea/caches/build_file_checksums.ser and /dev/null differ diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index 30aa626c..00000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/dictionaries/ganfra.xml b/.idea/dictionaries/ganfra.xml deleted file mode 100644 index 2c6e3c0c..00000000 --- a/.idea/dictionaries/ganfra.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - coroutine - moshi - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 043ba654..00000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 2679eba6..00000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 99202cc2..00000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460d..00000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..2ce6eec1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,60 @@ +# FTR: Configuration on https://travis-ci.org/vector-im/riotX-android/settings +# +# - Build only if .travis.yml is present -> On +# - Limit concurrent jobs -> Off +# - Build pushed branches -> On (build the branch) +# - Build pushed pull request -> On (build the PR after auto-merge) +# +# - Auto cancel branch builds -> On +# - Auto cancel pull request builds -> On + +language: android +jdk: oraclejdk8 +sudo: false + +notifications: + email: false + +android: + components: + # Uncomment the lines below if you want to + # use the latest revision of Android SDK Tools + - tools + - platform-tools + + # The BuildTools version used by your project + - build-tools-28.0.3 + + # The SDK version used to compile your project + - android-28 + +before_cache: + - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ + +cache: + directories: + - $HOME/.gradle/caches/ + - $HOME/.gradle/wrapper/ + - $HOME/.android/build-cache + +# Build with the development SDK +before_script: + # Not necessary for the moment + # - /bin/sh ./set_debug_env.sh + +# Just build the project for now +script: + # Build app (assembleGplayRelease assembleFdroidRelease) + # Build Android test (assembleAndroidTest) (disabled for now) + # Code quality (lintGplayRelease lintFdroidRelease) + # Split into two steps because if a task contain Fdroid, PlayService will be disabled + - ./gradlew clean assembleGplayRelease lintGplayRelease --stacktrace + - ./gradlew clean assembleFdroidRelease lintFdroidRelease --stacktrace + # Run unitary test (Disable for now, see https://travis-ci.org/vector-im/riot-android/builds/502504370) + # - ./gradlew testGplayReleaseUnitTest --stacktrace + # Other code quality check + - ./tools/check/check_code_quality.sh + - ./tools/travis/check_pr.sh + # Check that indonesians file are identical. Due to Android issue, the resource folder must be value-in/, and Weblate export data into value-id/. + - diff ./vector/src/main/res/values-id/strings.xml ./vector/src/main/res/values-in/strings.xml diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 00000000..e69de29b diff --git a/CHANGES.md b/CHANGES.md new file mode 100644 index 00000000..7b52a037 --- /dev/null +++ b/CHANGES.md @@ -0,0 +1,49 @@ +Changes in RiotX 0.XX (2019-XX-XX) +=================================================== + +Features: + - Contextual action menu for messages in room + +Improvements: + - + +Other changes: + - + +Bugfix: + - + +Translations: + - + +Build: + - + + + +======================================================= ++ TEMPLATE WHEN PREPARING A NEW RELEASE + +======================================================= + + +Changes in RiotX 0.XX (2019-XX-XX) +=================================================== + +Features: + - + +Improvements: + - + +Other changes: + - + +Bugfix: + - + +Translations: + - + +Build: + - + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..449f6421 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,76 @@ +# Contributing code to Matrix + +Please read https://github.com/matrix-org/synapse/blob/master/CONTRIBUTING.rst + +Android support can be found in this [![Riot Android Matrix room #riot-android:matrix.org](https://img.shields.io/matrix/riot-android:matrix.org.svg?label=%23riot-android:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#riot-android:matrix.org) room. + +Dedicated room for RiotX: [![RiotX Android Matrix room #riot-android:matrix.org](https://img.shields.io/matrix/riotx:matrix.org.svg?label=%23RiotX:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#riotx:matrix.org) + +# Specific rules for Matrix Android projects + +## Android Studio settings + +Please set the "hard wrap" setting of Android Studio to 160 chars, this is the setting we use internally to format the source code (Menu `Settings/Editor/Code Style` then `Hard wrap at`). + +## Compilation + +For now, the Matrix SDK and the RiotX application are in the same project. So there is no specific thing to do, this project should compile without any special action. + +## I want to help translating RiotX + +If you want to fix an issue with an English string, please submit a PR. +If you want to fix an issue in other languages, or add a missing translation, or even add a new language, please use [Weblate](https://translate.riot.im/projects/riot-android/). + +For the moment, Strings from Riot will be used, there is no dedicated project in Weblate for RiotX. + +## I want to submit a PR to fix an issue + +Please check if a corresponding issue exists. If yes, please let us know in a comment that you're working on it. +If an issue does not exist yet, it may be relevant to open a new issue and let us know that you're implementing it. + +### Kotlin + +This project is full Kotlin. Please do not write Java classes. + +### CHANGES.md + +Please add a line to the top of the file `CHANGES.md` describing your change. + +### Code quality + +Make sure the following commands execute without any error: + +> ./tools/check/check_code_quality.sh + +> ./gradlew lintGplayRelease + +### Unit tests + +Make sure the following commands execute without any error: + +> ./gradlew testGplayReleaseUnitTest + +### Tests + +RiotX is currently supported on Android Jelly Bean (API 16+): please test your change on an Android device (or Android emulator) running with API 16. Many issues can happen (including crashes) on older devices. +Also, if possible, please test your change on a real device. Testing on Android emulator may not be sufficient. + +### Internationalisation + +When adding new string resources, please only add new entries in file `value/strings.xml`. Translations will be added later by the community of translators with a specific tool named [Weblate](https://translate.riot.im/projects/riot-android/). +Do not hesitate to use plurals when appropriate. + +### Layout + +When adding or editing layouts, make sure the layout will render correctly if device uses a RTL (Right To Left) language. +You can check this in the layout editor preview by selecting any RTL language (ex: Arabic). + +Also please check that the colors are ok for all the current themes of RiotX. Please use `?attr` instead of `@color` to reference colors in the layout. You can check this in the layout editor preview by selecting all the main themes (`AppTheme.Status`, `AppTheme.Dark`, etc.). + +### Authors + +Feel free to add an entry in file AUTHORS.md + +## Thanks + +Thanks for contributing to Matrix projects! diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..d9a10c0d --- /dev/null +++ b/LICENSE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/README.md b/README.md index e1f84f4f..2fe92f58 100644 --- a/README.md +++ b/README.md @@ -1 +1,20 @@ -# riot-android-redesign-PoC +[![Buildkite](https://badge.buildkite.com/657d3db27364448d69d54f66c690f7788bc6aa80a7628e37f3.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riotx-android) +[![Weblate](https://translate.riot.im/widgets/riot-android/-/svg-badge.svg)](https://translate.riot.im/engage/riot-android/?utm_source=widget) +[![RiotX Android Matrix room #riot-android:matrix.org](https://img.shields.io/matrix/riotx:matrix.org.svg?label=%23RiotX:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#riotx:matrix.org) +[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riotx&metric=alert_status)](https://sonarcloud.io/dashboard?id=vector.android.riotx) +[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riotx&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=vector.android.riotx) +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=vector.android.riotx&metric=bugs)](https://sonarcloud.io/dashboard?id=vector.android.riotx) + +# RiotX Android + +RiotX is an Android Matrix Client currently in development. The application is not yet available on the PlayStore. + +It's based on a new Matrix SDK, written in Kotlin. + +Download nightly build here: [![Buildkite](https://badge.buildkite.com/657d3db27364448d69d54f66c690f7788bc6aa80a7628e37f3.svg?branch=develop)](https://buildkite.com/matrix-dot-org/riotx-android/builds?branch=develop) + +Matrix Room: [![RiotX Android Matrix room #riot-android:matrix.org](https://img.shields.io/matrix/riotx:matrix.org.svg?label=%23RiotX:matrix.org&logo=matrix&server_fqdn=matrix.org)](https://matrix.to/#/#riotx:matrix.org) + +## Contributing + +Please refer to [CONTRIBUTING.md](https://github.com/vector-im/riotX-android/blob/develop/CONTRIBUTING.md) if you want to contribute the Matrix on Android projects! diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 0e4eafaa..00000000 --- a/app/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' - -android { - compileSdkVersion 28 - defaultConfig { - applicationId "im.vector.riotredesign" - minSdkVersion 21 - targetSdkVersion 28 - versionCode 1 - versionName "1.0" - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation project(":matrix-sdk-core") - - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support.constraint:constraint-layout:1.1.3' - implementation "org.koin:koin-core:$koin_version" - implementation "org.koin:koin-core-ext:$koin_version" - - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' - compile project(path: ':matrix-sdk-android') -} diff --git a/app/src/androidTest/java/im/vector/riotredesign/ExampleInstrumentedTest.kt b/app/src/androidTest/java/im/vector/riotredesign/ExampleInstrumentedTest.kt deleted file mode 100644 index b9ed47d0..00000000 --- a/app/src/androidTest/java/im/vector/riotredesign/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package im.vector.riotredesign - -import android.support.test.InstrumentationRegistry -import android.support.test.runner.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getTargetContext() - assertEquals("im.vector.riotredesign", appContext.packageName) - } -} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml deleted file mode 100644 index 54863ea5..00000000 --- a/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/java/im/vector/riotredesign/Riot.kt b/app/src/main/java/im/vector/riotredesign/Riot.kt deleted file mode 100644 index d916a1d2..00000000 --- a/app/src/main/java/im/vector/riotredesign/Riot.kt +++ /dev/null @@ -1,13 +0,0 @@ -package im.vector.riotredesign - -import android.app.Application -import org.koin.standalone.StandAloneContext.startKoin - -class Riot : Application() { - - override fun onCreate() { - super.onCreate() - startKoin(emptyList()) - } - -} \ No newline at end of file diff --git a/app/src/main/java/im/vector/riotredesign/core/platform/RiotActivity.kt b/app/src/main/java/im/vector/riotredesign/core/platform/RiotActivity.kt deleted file mode 100644 index d6e3ccb2..00000000 --- a/app/src/main/java/im/vector/riotredesign/core/platform/RiotActivity.kt +++ /dev/null @@ -1,7 +0,0 @@ -package im.vector.riotredesign.core.platform - -import android.support.v7.app.AppCompatActivity - -open class RiotActivity : AppCompatActivity() { - -} \ No newline at end of file diff --git a/app/src/main/java/im/vector/riotredesign/core/platform/RiotFragment.kt b/app/src/main/java/im/vector/riotredesign/core/platform/RiotFragment.kt deleted file mode 100644 index 3a6a5f6c..00000000 --- a/app/src/main/java/im/vector/riotredesign/core/platform/RiotFragment.kt +++ /dev/null @@ -1,6 +0,0 @@ -package im.vector.riotredesign.core.platform - -import android.support.v4.app.Fragment - -class RiotFragment : Fragment() { -} \ No newline at end of file diff --git a/app/src/main/java/im/vector/riotredesign/features/home/HomeActivity.kt b/app/src/main/java/im/vector/riotredesign/features/home/HomeActivity.kt deleted file mode 100644 index 93953b7f..00000000 --- a/app/src/main/java/im/vector/riotredesign/features/home/HomeActivity.kt +++ /dev/null @@ -1,25 +0,0 @@ -package im.vector.riotredesign.features.home - -import android.content.Context -import android.content.Intent -import android.os.Bundle -import im.vector.riotredesign.R -import im.vector.riotredesign.core.platform.RiotActivity - -class HomeActivity : RiotActivity() { - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_home) - } - - - companion object { - - fun newIntent(context: Context): Intent { - return Intent(context, HomeActivity::class.java) - } - - } - -} \ No newline at end of file diff --git a/app/src/main/java/im/vector/riotredesign/features/login/LoginActivity.kt b/app/src/main/java/im/vector/riotredesign/features/login/LoginActivity.kt deleted file mode 100644 index fb0f658b..00000000 --- a/app/src/main/java/im/vector/riotredesign/features/login/LoginActivity.kt +++ /dev/null @@ -1,54 +0,0 @@ -package im.vector.riotredesign.features.login - -import android.os.Bundle -import android.view.View -import android.widget.Toast -import im.vector.matrix.android.thread.MainThreadExecutor -import im.vector.matrix.core.api.Matrix -import im.vector.matrix.core.api.MatrixCallback -import im.vector.matrix.core.api.MatrixOptions -import im.vector.matrix.core.api.failure.Failure -import im.vector.matrix.core.api.login.data.Credentials -import im.vector.matrix.core.api.login.data.HomeServerConnectionConfig -import im.vector.riotredesign.R -import im.vector.riotredesign.core.platform.RiotActivity -import im.vector.riotredesign.features.home.HomeActivity -import kotlinx.android.synthetic.main.activity_login.* - -class LoginActivity : RiotActivity() { - - private val matrixOptions = MatrixOptions(mainExecutor = MainThreadExecutor()) - private val matrix = Matrix(matrixOptions) - private val homeServerConnectionConfig = HomeServerConnectionConfig("https://matrix.org/") - private val session = matrix.createSession(homeServerConnectionConfig) - private val authenticator = session.authenticator() - - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - setContentView(R.layout.activity_login) - authenticateButton.setOnClickListener { authenticate() } - } - - private fun authenticate() { - val login = loginField.text.trim().toString() - val password = passwordField.text.trim().toString() - progressBar.visibility = View.VISIBLE - authenticator.authenticate(login, password, object : MatrixCallback { - override fun onSuccess(data: Credentials?) { - goToHomeScreen() - } - - override fun onFailure(failure: Failure) { - progressBar.visibility = View.GONE - Toast.makeText(this@LoginActivity, "Authenticate failure: $failure", Toast.LENGTH_LONG).show() - } - }) - } - - private fun goToHomeScreen() { - val intent = HomeActivity.newIntent(this) - startActivity(intent) - finish() - } - -} diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml deleted file mode 100644 index c7bd21db..00000000 --- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml deleted file mode 100644 index d5fccc53..00000000 --- a/app/src/main/res/drawable/ic_launcher_background.xml +++ /dev/null @@ -1,170 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml deleted file mode 100644 index 84615cdd..00000000 --- a/app/src/main/res/layout/activity_home.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_login.xml b/app/src/main/res/layout/activity_login.xml deleted file mode 100644 index c8984e15..00000000 --- a/app/src/main/res/layout/activity_login.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - -