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 +12
-3
lines changed
app/src/main/java/com/zulip/android Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 41
41
import com .zulip .android .networking .response .ZulipBackendResponse ;
42
42
import com .zulip .android .networking .util .DefaultCallback ;
43
43
import com .zulip .android .util .AnimationHelper ;
44
+ import com .zulip .android .util .Constants ;
44
45
45
46
import org .json .JSONException ;
46
47
import org .json .JSONObject ;
@@ -98,6 +99,10 @@ protected void onCreate(Bundle savedInstanceState) {
98
99
mPassword = (EditText ) findViewById (R .id .password );
99
100
mShowPassword = (ImageView ) findViewById (R .id .showPassword );
100
101
serverIn = (EditText ) findViewById (R .id .server_url_in );
102
+ String serverUrl = getIntent ().getStringExtra (Constants .SERVER_URL );
103
+ if (serverUrl != null ) {
104
+ serverIn .setText (serverUrl );
105
+ }
101
106
findViewById (R .id .server_btn ).setOnClickListener (new View .OnClickListener () {
102
107
@ Override
103
108
public void onClick (View view ) {
Original file line number Diff line number Diff line change 102
102
import com .zulip .android .networking .ZulipAsyncPushTask ;
103
103
import com .zulip .android .networking .response .UploadResponse ;
104
104
import com .zulip .android .util .AnimationHelper ;
105
+ import com .zulip .android .util .Constants ;
105
106
import com .zulip .android .util .FilePathHelper ;
106
107
import com .zulip .android .util .MutedTopics ;
107
108
import com .zulip .android .util .RemoveViewsOnScroll ;
@@ -321,7 +322,7 @@ protected void onCreate(Bundle savedInstanceState) {
321
322
processParams ();
322
323
323
324
if (!app .isLoggedIn ()) {
324
- openLogin ();
325
+ openLogin (null );
325
326
return ;
326
327
}
327
328
@@ -2120,20 +2121,22 @@ private void setNightMode(@AppCompatDelegate.NightMode int nightMode) {
2120
2121
*/
2121
2122
private void logout () {
2122
2123
this .logged_in = false ;
2124
+ final String serverUrl = app .getServerURI ();
2123
2125
2124
2126
notifications .logOut (new Runnable () {
2125
2127
public void run () {
2126
2128
app .logOut ();
2127
- openLogin ();
2129
+ openLogin (serverUrl );
2128
2130
}
2129
2131
});
2130
2132
}
2131
2133
2132
2134
/**
2133
2135
* Switch to the login view.
2134
2136
*/
2135
- private void openLogin () {
2137
+ private void openLogin (String serverUrl ) {
2136
2138
Intent i = new Intent (this , LoginActivity .class );
2139
+ i .putExtra (Constants .SERVER_URL , serverUrl );
2137
2140
startActivity (i );
2138
2141
finish ();
2139
2142
}
Original file line number Diff line number Diff line change @@ -13,5 +13,6 @@ public class Constants {
13
13
//Default maximum time limit for editing message(Same as server)
14
14
public final static int DEFAULT_MAXIMUM_CONTENT_EDIT_LIMIT = 600 ;
15
15
public final static boolean DEFAULT_EDITING_ALLOWED = true ;
16
+ public final static String SERVER_URL = "SERVER_URL" ;
16
17
17
18
}
You can’t perform that action at this time.
0 commit comments