limit input fields on login activity to one line
This commit is contained in:
parent
6485f60cf8
commit
61f50b401f
3 changed files with 17 additions and 2 deletions
|
|
@ -84,6 +84,7 @@ public class LoginActivity extends AbsBaseActivity implements View.OnClickListen
|
|||
onBackPressed();
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
android:layout_marginEnd="32dp"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="8dp"
|
||||
android:inputType="textShortMessage"
|
||||
android:hint="@string/username" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
|
@ -65,6 +66,7 @@
|
|||
android:layout_marginEnd="32dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:inputType="textShortMessage"
|
||||
android:hint="@string/server" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue