From 46b1bba9979265e07c94cdb06fb5f0ec0c38055e Mon Sep 17 00:00:00 2001 From: crimean Date: Mon, 18 Jun 2018 00:08:29 +0300 Subject: [PATCH] Refactored Login screen --- OsmAnd-telegram/build.gradle | 200 +++++------ .../res/drawable-hdpi/ic_arrow_back.png | Bin 0 -> 1212 bytes .../res/drawable-mdpi/ic_arrow_back.png | Bin 0 -> 1127 bytes .../res/drawable-xhdpi/ic_arrow_back.png | Bin 0 -> 1294 bytes .../res/drawable-xxhdpi/ic_arrow_back.png | Bin 0 -> 1385 bytes OsmAnd-telegram/res/drawable/btn_round.xml | 23 ++ .../res/drawable/btn_round_blue.xml | 23 ++ OsmAnd-telegram/res/layout/activity_main.xml | 42 ++- .../res/layout/install_osmand_dialog.xml | 2 +- OsmAnd-telegram/res/layout/login_dialog.xml | 325 +++++++++++------- .../res/menu/bottom_navigation_menu.xml | 12 + OsmAnd-telegram/res/values/attrs.xml | 2 + OsmAnd-telegram/res/values/colors.xml | 33 +- OsmAnd-telegram/res/values/dimens.xml | 21 +- OsmAnd-telegram/res/values/strings.xml | 129 +++---- OsmAnd-telegram/res/values/styles.xml | 62 +++- .../osmand/telegram/LoginDialogFragment.kt | 182 +++++++--- .../src/net/osmand/telegram/MainActivity.kt | 23 +- .../net/osmand/telegram/utils/AndroidUtils.kt | 1 + 19 files changed, 703 insertions(+), 377 deletions(-) create mode 100644 OsmAnd-telegram/res/drawable-hdpi/ic_arrow_back.png create mode 100644 OsmAnd-telegram/res/drawable-mdpi/ic_arrow_back.png create mode 100644 OsmAnd-telegram/res/drawable-xhdpi/ic_arrow_back.png create mode 100644 OsmAnd-telegram/res/drawable-xxhdpi/ic_arrow_back.png create mode 100644 OsmAnd-telegram/res/drawable/btn_round.xml create mode 100644 OsmAnd-telegram/res/drawable/btn_round_blue.xml create mode 100644 OsmAnd-telegram/res/menu/bottom_navigation_menu.xml diff --git a/OsmAnd-telegram/build.gradle b/OsmAnd-telegram/build.gradle index dfd1fed11e..3355892eb1 100644 --- a/OsmAnd-telegram/build.gradle +++ b/OsmAnd-telegram/build.gradle @@ -4,128 +4,134 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' android { - compileSdkVersion 27 + compileSdkVersion 27 + buildToolsVersion "27.0.3" - sourceSets { - main { - manifest.srcFile "AndroidManifest.xml" - jni.srcDirs = [] - jniLibs.srcDirs = ["libs"] - aidl.srcDirs = ["src"] - java.srcDirs = ["src"] - resources.srcDirs = ["src"] - res.srcDirs = ["res"] - } - } + sourceSets { + main { + manifest.srcFile "AndroidManifest.xml" + jni.srcDirs = [] + jniLibs.srcDirs = ["libs"] + aidl.srcDirs = ["src"] + java.srcDirs = ["src"] + resources.srcDirs = ["src"] + res.srcDirs = ["res"] + } + } - defaultConfig { - applicationId "net.osmand.telegram" - minSdkVersion 15 - targetSdkVersion 27 - versionCode 1 - versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode - versionName "1.0" - versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName - } + defaultConfig { + applicationId "net.osmand.telegram" + minSdkVersion 15 + targetSdkVersion 27 + versionCode 1 + versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode + versionName "1.0" + versionName System.getenv("APK_VERSION") ? System.getenv("APK_VERSION").toString() : versionName + } - flavorDimensions "abi" + flavorDimensions "abi" - productFlavors { - x86 { - dimension "abi" - ndk { - abiFilter "x86" - } - } - armv7 { - dimension "abi" - ndk { - abiFilter "armeabi-v7a" - } - } - arm64 { - dimension "abi" - ndk { - abiFilter "arm64-v8a" - } - } - fat { - dimension "abi" - } - } - signingConfigs { - development { - storeFile file("../keystores/debug.keystore") - storePassword "android" - keyAlias "androiddebugkey" - keyPassword "android" - } + productFlavors { + x86 { + dimension "abi" + ndk { + abiFilter "x86" + } + } + armv7 { + dimension "abi" + ndk { + abiFilter "armeabi-v7a" + } + } + arm64 { + dimension "abi" + ndk { + abiFilter "arm64-v8a" + } + } + fat { + dimension "abi" + } + } + signingConfigs { + development { + storeFile file("../keystores/debug.keystore") + storePassword "android" + keyAlias "androiddebugkey" + keyPassword "android" + } - publishing { - storeFile file("/var/lib/jenkins/osmand_key") - storePassword System.getenv("OSMAND_APK_PASSWORD") - keyAlias "osmand" - keyPassword System.getenv("OSMAND_APK_PASSWORD") - } - } + publishing { + storeFile file("/var/lib/jenkins/osmand_key") + storePassword System.getenv("OSMAND_APK_PASSWORD") + keyAlias "osmand" + keyPassword System.getenv("OSMAND_APK_PASSWORD") + } + } - buildTypes { - debug { - signingConfig signingConfigs.development - applicationIdSuffix ".debug" - } - release { - signingConfig signingConfigs.publishing - } - } + buildTypes { + debug { + signingConfig signingConfigs.development + applicationIdSuffix ".debug" + } + release { + signingConfig signingConfigs.publishing + } + } - - lintOptions { - // use this line to check all rules except those listed - disable 'InvalidPackage' - } + + lintOptions { + // use this line to check all rules except those listed + disable 'InvalidPackage' + } } task downloadTdLibzip { - doLast { - ant.get(src: 'https://core.telegram.org/tdlib/tdlib.zip', dest: 'tdlib.zip', skipexisting: 'true') - ant.unzip(src: 'tdlib.zip', dest: 'tdlib/') - } + doLast { + ant.get(src: 'https://core.telegram.org/tdlib/tdlib.zip', dest: 'tdlib.zip', skipexisting: 'true') + ant.unzip(src: 'tdlib.zip', dest: 'tdlib/') + } } task copyNativeLibs(type: Copy) { - dependsOn downloadTdLibzip - from "tdlib/libtd/src/main/libs" - into "libs" + dependsOn downloadTdLibzip + from "tdlib/libtd/src/main/libs" + into "libs" } -task copyJavaSources(type: Copy) { - dependsOn downloadTdLibzip - from "tdlib/libtd/src/main/java/org/drinkless/td" - into "src/org/drinkless/td" +task copyJavaSources(type: Copy) { + dependsOn downloadTdLibzip + from "tdlib/libtd/src/main/java/org/drinkless/td" + into "src/org/drinkless/td" } task downloadPrebuiltTelegram { - dependsOn downloadTdLibzip, copyNativeLibs, copyJavaSources + dependsOn downloadTdLibzip, copyNativeLibs, copyJavaSources } afterEvaluate { - android.applicationVariants.all { variant -> - variant.javaCompiler.dependsOn(downloadPrebuiltTelegram) - variant.preBuild.dependsOn(downloadPrebuiltTelegram) - } + android.applicationVariants.all { variant -> + variant.javaCompiler.dependsOn(downloadPrebuiltTelegram) + variant.preBuild.dependsOn(downloadPrebuiltTelegram) + } } dependencies { - implementation project(path: ':OsmAnd-java', configuration: 'android') - implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation project(path: ':OsmAnd-java', configuration: 'android') + implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation 'com.android.support:appcompat-v7:27.1.1' - implementation 'com.android.support:support-annotations:27.1.1' - implementation 'commons-logging:commons-logging-api:1.1' - implementation 'com.android.support:recyclerview-v7:27.1.1' - implementation 'com.vividsolutions:jts-core:1.14.0' + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation 'com.android.support:appcompat-v7:27.1.1' + implementation 'com.android.support:design:27.1.1' + implementation 'com.android.support:customtabs:27.1.1' + implementation 'com.android.support:support-annotations:27.1.1' + implementation 'commons-logging:commons-logging-api:1.1' + implementation 'com.android.support:recyclerview-v7:27.1.1' + implementation 'com.vividsolutions:jts-core:1.14.0' + implementation("com.github.HITGIF:TextFieldBoxes:1.4.4") { + exclude group: 'com.android.support' + } } diff --git a/OsmAnd-telegram/res/drawable-hdpi/ic_arrow_back.png b/OsmAnd-telegram/res/drawable-hdpi/ic_arrow_back.png new file mode 100644 index 0000000000000000000000000000000000000000..7a975df6138c61c9a61a4c183f90447dd992acd6 GIT binary patch literal 1212 zcmbVMTWB0r7@iQ*N=zxWsI3<`PK!3dx$ew%cbaLsnb~a?+;rV6b_s}{nR6x?leu)} zq&u6S(4ay=gklSQ5sMFfGLotwC^Vo&qs1$+RPjO4mx?u7?VEyUlHKS-=!3(|oOAy9 zzW@Hu$?E9gZN2yQG7Ph=JYv@9x;K4p-$LI%FlW!wWj84{$XMWzCX6ssK!Jrp*@F|f zh9PPl`xp;0O!ur?Z;(diQOyoK9;O&R@j}XGn8BeWg!U9Bz`_%*ud}P~EwR8wI(t;D zh?UU5lkUiDgvVw_>-OxFok#4@K`@wTRDp*H1c^88$6BJZYkD=hPsIWY)*xg`XV;x- zRI0!TA`DbM%h^&!2K)28q~_(E@(7ScDJzJIAmuqJqtROtLHlBmzz3;DXazGwXQ`*_ zA$Vb>vZ2_I+litn6A~B-5-$p#m&Ub*j!6yw>&B+&xZVn}P{VOB6WO#L&YljL=I+*p zQXut4I}*9HC~(>g>=_UHq-^Re{lX&`X>w+N9wIDpNXcb5EGw9^Y)j@82O%+M%g`2a zN6%*bqLM3!;;?Cmk|;^V>~OK57#S&}7IP(~BpV%W*^deIZQQZ#Qrm5=aZ9ddL>Q7F zst3Vzrwgi+0SV&CAOwbyR$b*)u&)Ab*H6X$X{pvDH*w@1$EXwq9$3q@=5FE#lya7m z&(el+atfy?qRl}SXE{gBIvGb45q4Cz%}4(?hXQp%SiRl#bffvRSAn-~Mv-iQW%DAM?G|Tzm!L1C2uP=G;Pjs`49r`$J_&>~1Z7 zabw5IbMK!13iXe^d|}tQrQ2G|J<&n)^pV{U>S*NEWcag7tEUF)1M$L@dlq`XKGVNr z>GSek^7GfaE?A4;c;A-2^KQ>cIDTkJJaNZcTkrhnCvx8()r)`nFM5~Z+&7oU2pS*Tv?EL)u->tCwrUm=(O)~d*eRc5C3tD9Ljqm*N?x(-J|Hjef1L*ZD y+kY-T^U%d7t35lHA87vd_pWnY)=Td&-OP!u-%Afac4%w*KPeYS%{PXhn*Rrvu$7en literal 0 HcmV?d00001 diff --git a/OsmAnd-telegram/res/drawable-mdpi/ic_arrow_back.png b/OsmAnd-telegram/res/drawable-mdpi/ic_arrow_back.png new file mode 100644 index 0000000000000000000000000000000000000000..c14541d3d78fd2aaececa62031a3c6a364b73d3f GIT binary patch literal 1127 zcmbVL&r1|h9G}e$5e!QZEuzPGsHFM1Gwbf;y1BEvxzO6SF0>LsZ)V=Cqs|X!p6%)( z`TBZR!9&=4xgFd2$4Oc@TZ^J4oA!y9ate`=PYMHmn z6OJ{+|3o(wDI3d9ZQH8t`4;l|my!nQylrp)7FLFxK6Bv66$JJ^zwiabw zze=!)1jmbx>ihH7#UNp!=4GE!P2|MX0&6I7yR8cT%vuLSfgi6Eq4% zO2*Zp#|bRY*>;%MwswF^=x-Q%Y6s;x4{;?FxU;@a`eF7p!K8NkI|>y^G|DC4B29tQ z8CRdRk%RM@Bu#Eu!!i^xI*@<{5*R~@M;Rnah|zRSWF*rt__!`YokvYOd*QQcE~g4< zQRM|*5VEm!c34uQLR8Mib5c%Jo7lV)VCd+m>DwZ{8(3jqtfKk|V%IOb?sRhsiW4q& zg9+CIsv34(W@T`?0Cmd=#b?4+?PQ)ozI6i`Ip4LxcC8g_k2s(Z*Q7*@43rs{7)j!F z2FfVLm~zaFnmlhHQ>Ghu<9}<&k)XJ6VE!4Prie^sxZR}#IqVV&IfO+%p-YPSP$g8m zo6iiF>ucKYt*ulG6ZyQ(wo7`Nud&cP!70pO=@1d#(O9i5Qe8T+vij&-@8qem vr{n3#%QFjW+16|A=N1>gf9em`8LEw^(kJ`BzAe62L+av#SD3!!KM literal 0 HcmV?d00001 diff --git a/OsmAnd-telegram/res/drawable-xhdpi/ic_arrow_back.png b/OsmAnd-telegram/res/drawable-xhdpi/ic_arrow_back.png new file mode 100644 index 0000000000000000000000000000000000000000..e212ab8f5c75f728e2ea60183688bedd7c31eb2f GIT binary patch literal 1294 zcmbVMeP|nH7{4T?n=u`9)3Fb6=hcmx^*(c#=FY~_=F%nIl9e>DAfmn8z1Lim++FXk zOkxV=@s`M7p9VY<~^1Km5d@zSkzzKg#~_xV!gx zpZoou=XsxxTNp_n=F=)s*BSaL_y$*YqgXSh|Fv zni9p1a49Nf#y~+!%vxY{Hl3Aci!!fZ{ZF8MRRJ0(14lxu<&tg-)hM=VSAepsCNXps z;uNFUT2Q&v2pTgifO13_m+26L_VNVH@l1s6K^ck;lN3wRJWhuMc(WARyfEm^QdA)$ z4mEwjT@))gjwz62rBWd(A;Pf6A(!V#iXj;WhX~xB(H*IZ>vmVmf(UHc(o9D)bkwyd z<&7yPiorg6Q`(73`zLO5Vpfam2r zgR`olP!XAtWD2zGY{ZYVkpYSthkRq^p-1BAb$K@v@LXg<%Kr_=p^61 zDM|c7A*J!gE(g<|=!(?)TSAZvxv#eD&(c5B-fr&n+l?()sYg8s2vlDgK`G z{CbD>Vprz;^Y`t+(BR#iXY$9Zo96?Kcb+*p{J`b;yKkf$J3oEvx-a}oUEOpt zv%OINq9*!!o<6+be}8(pAx?dnc2d&r2lsa_56{0euiX+8pI!X=_SPM~j>Wcb6W8|D z`ETA!jD7!N-23Oz;|Ir1UH|yTu@CKM+j~ZZ6@-}YauVktIxY-_jS37WN l+hWasw&uTk;c~3zK~^4_IrY?|E1m8iDj83UZx4<={||+~uZI8t literal 0 HcmV?d00001 diff --git a/OsmAnd-telegram/res/drawable-xxhdpi/ic_arrow_back.png b/OsmAnd-telegram/res/drawable-xxhdpi/ic_arrow_back.png new file mode 100644 index 0000000000000000000000000000000000000000..1766bbc0ef7fcac789bc58efde50d55e789c359f GIT binary patch literal 1385 zcmbVMeN5bB81Dw$07cn?PN#uV(6C9bAJ@Cxo!kcZ#hrS19*4VOvaHv>g%hqVZSf9b zG!$iuGLRXv=rZSqAB(W%#KakyQxplr%q)vbre^*z-NbEKqD!2a8s7qk{z3MKP22Z< zpFY3mkVbPPh;K_xxYMSgMh*TCmrTxSx9TF~pl;1@HW;GMK(vxDUUh4YNv zf&-cXc$|yVI3w^pY3FE`BSF^AN_fWNC*5wV&F%No6y>wIeRYh-LRqXnyPxsXo-8&f zsv0YDAnQ8;eJ^3HH^n+V3Sc!!iAqv?whO|ok|wFGl8kyhM%ArmD_Rv|xrAtlHyWi{ z%-jo<#8ZIxD^e0&;M$p3Ar6+Z#~FtWHk4pzaE2i{oV5ZQE?8}XMIcEY2v%$f&;MTz z2^bV%G|Yb*C@X?pX>6Cr0UnkI3W#uu6gV!|pWRcAAgi7adh4R;Z!dqJ5vOWzHSHW; zyQ9B<{D3$aD0^-_>j7hPjhVg&=S_Wm%|EsO`Q3^8ZV$fw^g}0G9+)FTr**2Vq9EUk zu3q~>Z7x>ab5|}FZa)BK)!Cw+3mxYk-d|Hbuv z!IJrx_0i0p5p?{qp%0n|$iQpIWBHX=ggZ)S55B(3|Ne&5r`YzBz33}rYXmuPbZ?cr z{P>eUZt^*WykYd4OS`_R9US`QkHO&|&h|XxQF + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd-telegram/res/drawable/btn_round_blue.xml b/OsmAnd-telegram/res/drawable/btn_round_blue.xml new file mode 100644 index 0000000000..fb0e06cfb9 --- /dev/null +++ b/OsmAnd-telegram/res/drawable/btn_round_blue.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd-telegram/res/layout/activity_main.xml b/OsmAnd-telegram/res/layout/activity_main.xml index 94c382c0dc..2036b6bcbe 100644 --- a/OsmAnd-telegram/res/layout/activity_main.xml +++ b/OsmAnd-telegram/res/layout/activity_main.xml @@ -1,14 +1,34 @@ - + - + - \ No newline at end of file + + + + + + + \ No newline at end of file diff --git a/OsmAnd-telegram/res/layout/install_osmand_dialog.xml b/OsmAnd-telegram/res/layout/install_osmand_dialog.xml index 4708b4c39a..9d4e60ef21 100644 --- a/OsmAnd-telegram/res/layout/install_osmand_dialog.xml +++ b/OsmAnd-telegram/res/layout/install_osmand_dialog.xml @@ -7,7 +7,7 @@ diff --git a/OsmAnd-telegram/res/layout/login_dialog.xml b/OsmAnd-telegram/res/layout/login_dialog.xml index 2db8deb9b0..ddf957149f 100644 --- a/OsmAnd-telegram/res/layout/login_dialog.xml +++ b/OsmAnd-telegram/res/layout/login_dialog.xml @@ -1,143 +1,234 @@ - + - + - + - + - + - + - +