limit input fields on login activity to one line

This commit is contained in:
dkanada 2020-06-17 14:59:01 +09:00
commit 61f50b401f
3 changed files with 17 additions and 2 deletions

View file

@ -84,6 +84,7 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
onBackPressed();
return true;
}
return super.onOptionsItemSelected(item);
}

View file

@ -10,6 +10,7 @@ import com.dkanada.gramophone.ui.activities.base.AbsBaseActivity;
import org.jellyfin.apiclient.interaction.AndroidCredentialProvider;
import org.jellyfin.apiclient.interaction.ConnectionResult;
import org.jellyfin.apiclient.interaction.EmptyResponse;
import org.jellyfin.apiclient.interaction.Response;
import org.jellyfin.apiclient.interaction.VolleyHttpClient;
import org.jellyfin.apiclient.interaction.connectionmanager.ConnectionManager;
@ -25,6 +26,9 @@ import butterknife.ButterKnife;
public class SplashActivity extends AbsBaseActivity {
public static final String TAG = SplashActivity.class.getSimpleName();
public AndroidCredentialProvider credentialProvider;
public ConnectionManager connectionManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -40,17 +44,25 @@ public class SplashActivity extends AbsBaseActivity {
ILogger logger = new AndroidLogger(TAG);
IAsyncHttpClient httpClient = new VolleyHttpClient(logger, this);
AndroidCredentialProvider credentialProvider = new AndroidCredentialProvider(jsonSerializer, this, logger);
credentialProvider = new AndroidCredentialProvider(jsonSerializer, this, logger);
connectionManager = App.getConnectionManager(this, jsonSerializer, logger, httpClient);
login();
}
public void login() {
if (credentialProvider.GetCredentials().getServers().size() == 0) {
Intent intent = new Intent(this, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);
} else {
final Context context = this;
ConnectionManager connectionManager = App.getConnectionManager(this, jsonSerializer, logger, httpClient);
connectionManager.Connect(credentialProvider.GetCredentials().getServers().get(0), new Response<ConnectionResult>() {
@Override
public void onResponse(ConnectionResult result) {
if (result.getState() != ConnectionState.SignedIn) {
connectionManager.DeleteServer(credentialProvider.GetCredentials().getServers().get(0).getId(), new EmptyResponse());
Intent intent = new Intent(context, LoginActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
context.startActivity(intent);