This repository was archived by the owner on Jul 25, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +29
-4
lines changed
java/com/zulip/android/activities Expand file tree Collapse file tree 3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ dependencies {
75
75
compile ' commons-lang:commons-lang:2.6'
76
76
compile ' org.ccil.cowan.tagsoup:tagsoup:1.2.1'
77
77
compile ' com.squareup.picasso:picasso:2.5.2'
78
+ compile ' com.android.support:customtabs:23.3.0'
78
79
compile(' com.crashlytics.sdk.android:crashlytics:2.6.2@aar' ) {
79
80
transitive = true ;
80
81
}
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" utf-8" ?>
2
2
<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3
- package = " com.zulip. android"
4
- >
3
+ xmlns : tools = " http://schemas. android.com/tools "
4
+ package = " com.zulip.android " >
5
5
6
6
<uses-permission android : name =" android.permission.INTERNET" />
7
7
<uses-permission android : name =" android.permission.GET_ACCOUNTS" />
17
17
<uses-permission android : name =" android.permission.USE_CREDENTIALS" />
18
18
<uses-permission android : name =" android.permission.VIBRATE" />
19
19
20
+ <uses-sdk android : targetSdkVersion =" 23" android : minSdkVersion =" 13"
21
+ tools : overrideLibrary =" com.android.support:customtabs:23.3.0,android.support.customtabs" />
22
+
20
23
<application
21
24
android : name =" com.zulip.android.ZulipApp"
22
25
android : allowBackup =" false"
Original file line number Diff line number Diff line change 5
5
import android .content .Intent ;
6
6
import android .content .IntentSender .SendIntentException ;
7
7
import android .net .Uri ;
8
+ import android .os .Build ;
8
9
import android .os .Bundle ;
10
+ import android .support .customtabs .CustomTabsIntent ;
9
11
import android .support .v7 .app .AlertDialog ;
10
12
import android .support .v7 .widget .Toolbar ;
11
13
import android .util .Log ;
@@ -446,14 +448,33 @@ public void onTaskFailure(String result) {
446
448
asyncDevGetEmails .execute ();
447
449
break ;
448
450
case R .id .register :
449
- Intent intent = new Intent (Intent .ACTION_VIEW ,Uri .parse (serverIn .getText ().toString ()+"register" ));
450
- startActivity (intent );
451
+ openRegister ();
451
452
break ;
452
453
default :
453
454
break ;
454
455
}
455
456
}
456
457
458
+ private void openRegister () {
459
+ Uri uri ;
460
+ if (serverIn ==null || serverIn .getText ().toString ().isEmpty () || serverIn .getText ().toString ().equals ("" ))
461
+ {
462
+ return ;
463
+ }else
464
+ {
465
+ uri = Uri .parse (serverIn .getText ().toString ()+"register" );
466
+ }
467
+ if (Build .VERSION .SDK_INT < 15 )
468
+ {
469
+ Intent intent = new Intent (Intent .ACTION_VIEW ,uri );
470
+ startActivity (intent );
471
+ return ;
472
+ }
473
+ CustomTabsIntent .Builder builder = new CustomTabsIntent .Builder ();
474
+ CustomTabsIntent intent = builder .build ();
475
+ intent .launchUrl (LoginActivity .this ,uri );
476
+ }
477
+
457
478
private boolean isInputValidForDevAuth () {
458
479
boolean isValid = true ;
459
480
You can’t perform that action at this time.
0 commit comments