Commit aaaecf2e authored by Javier Romero's avatar Javier Romero

Reimplement action field buttons

parent 2505c42c
......@@ -202,11 +202,12 @@ class ConnectionInfoEditorActivity : BaseActivity() {
override fun onNext(nothing: Unit) {
progressDialog?.dismiss()
val builder = AlertDialog.Builder(this@ConnectionInfoEditorActivity)
builder.setTitle("Success")
builder.setMessage("Connected to server successfully!")
builder.setNeutralButton("OK", null)
builder.create().show()
AlertDialog.Builder(this@ConnectionInfoEditorActivity)
.setTitle("Success")
.setMessage("Connected to server successfully!")
.setNeutralButton("OK", null)
.create()
.show()
}
}))
}
......
......@@ -13,9 +13,8 @@ public class FormFactory {
case MYSQL:
return new Form(context, layoutInflater.inflate(R.layout.form_mysql, null), driverType);
case MSSQL:
return new Form(context, layoutInflater.inflate(R.layout.form_mssql, null), driverType);
case SYBASE:
return new Form(context, layoutInflater.inflate(R.layout.form_sybase, null), driverType);
return new Form(context, layoutInflater.inflate(R.layout.form_mssql, null), driverType);
case POSTGRES:
return new Form(context, layoutInflater.inflate(R.layout.form_postgres, null), driverType);
default:
......
......@@ -17,50 +17,25 @@
android:orientation="vertical"
android:paddingBottom="@dimen/form_content_padding_bottom">
<include
layout="@layout/form_section_name"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
style="@style/Form.SectionLayout"
<include
layout="@layout/form_section_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="wrap_content" />
<LinearLayout
style="@style/Form.SectionLayout"
<include
layout="@layout/form_section_mssql"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_mssql"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="wrap_content" />
<LinearLayout
style="@style/Form.SectionLayout"
<include
layout="@layout/form_section_ssh_tunnel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_ssh_tunnel"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="wrap_content" />
</LinearLayout>
</app.devlife.connect2sql.ui.widget.NotifyingScrollView>
......
......@@ -22,31 +22,15 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
style="@style/Form.SectionLayout"
<include
layout="@layout/form_section_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="wrap_content" />
<LinearLayout
style="@style/Form.SectionLayout"
<include
layout="@layout/form_section_ssh_tunnel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_ssh_tunnel"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="wrap_content" />
</LinearLayout>
</app.devlife.connect2sql.ui.widget.NotifyingScrollView>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
......@@ -22,18 +23,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
style="@style/Form.SectionLayout"
<include
layout="@layout/form_section_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="wrap_content" />
<LinearLayout
style="@style/Form.SectionLayout"
......@@ -82,13 +75,15 @@
android:textOn="@string/form_yes"
android:textSize="@dimen/form_field_text_size" />
<ImageView
<app.devlife.connect2sql.ui.connection.form.ActionImageView
style="@style/Form.Action.Help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:layout_marginBottom="5dp"
android:visibility="visible" />
android:visibility="visible"
app:helpText="@string/help_use_ssl" />
</app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout>
<app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout
......@@ -109,31 +104,25 @@
android:textOn="@string/form_yes"
android:textSize="@dimen/form_field_text_size" />
<ImageView
<app.devlife.connect2sql.ui.connection.form.ActionImageView
style="@style/Form.Action.Help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|bottom"
android:layout_marginBottom="5dp"
android:visibility="visible" />
android:visibility="visible"
app:helpText="@string/help_trust_cert" />
</app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout>
</LinearLayout>
</android.support.design.card.MaterialCardView>
</LinearLayout>
<LinearLayout
style="@style/Form.SectionLayout"
<include
layout="@layout/form_section_ssh_tunnel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_ssh_tunnel"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
android:layout_height="wrap_content" />
</LinearLayout>
</app.devlife.connect2sql.ui.widget.NotifyingScrollView>
......
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:orientation="vertical"
tools:parentTag="android.widget.LinearLayout">
<TextView
<LinearLayout
style="@style/Form.SectionLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/form_header_underline"
android:drawableLeft="@drawable/ic_form_header_gears"
android:drawablePadding="10dp"
android:text="@string/form_advanced_options"
android:textSize="20dp" />
android:orientation="vertical">
<android.support.design.card.MaterialCardView
style="@style/Form.SectionCardLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:orientation="vertical">
android:background="@drawable/form_header_underline"
android:drawableLeft="@drawable/ic_form_header_gears"
android:drawablePadding="10dp"
android:text="@string/form_advanced_options"
android:textSize="20dp" />
<android.support.design.card.MaterialCardView
style="@style/Form.SectionCardLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout
style="@style/Form.FloatLabelLayout"
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginLeft="@dimen/activity_horizontal_margin"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:orientation="vertical">
<EditText
android:id="@+id/form_txt_domain"
style="@style/Form.EditText.Text"
<app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout
style="@style/Form.FloatLabelLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/form_hint_domain" />
android:layout_height="wrap_content">
<ImageView
style="@style/Form.Action.Help"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout>
<EditText
android:id="@+id/form_txt_domain"
style="@style/Form.EditText.Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/form_hint_domain" />
<app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout
style="@style/Form.FloatLabelLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<app.devlife.connect2sql.ui.connection.form.ActionImageView
style="@style/Form.Action.Help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:helpText="@string/help_domain" />
</app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout>
<EditText
android:id="@+id/form_txt_instance"
style="@style/Form.EditText.Text"
<app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout
style="@style/Form.FloatLabelLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/form_hint_instance" />
android:layout_height="wrap_content">
<EditText
android:id="@+id/form_txt_instance"
style="@style/Form.EditText.Text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/form_hint_instance" />
<app.devlife.connect2sql.ui.connection.form.ActionImageView
style="@style/Form.Action.Help"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:helpText="@string/help_instance" />
<ImageView
style="@style/Form.Action.Help"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout>
</app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout>
</LinearLayout>
</android.support.design.card.MaterialCardView>
</LinearLayout>
</android.support.design.card.MaterialCardView>
</LinearLayout>
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
......@@ -38,10 +38,11 @@
<requestFocus />
</EditText>
<ImageView
<app.devlife.connect2sql.ui.connection.form.ActionImageView
style="@style/Form.Action.Help"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
android:layout_height="wrap_content"
app:helpText="@string/help_name" />
</app.devlife.connect2sql.ui.widget.FloatLabelPlusLayout>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<app.devlife.connect2sql.ui.widget.NotifyingScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/form_buttons"
android:layout_marginBottom="@dimen/form_buttons_shadow_size_negative">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/form_content_padding_bottom">
<include
layout="@layout/form_section_name"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<LinearLayout
style="@style/Form.SectionLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
style="@style/Form.SectionLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_mssql"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<LinearLayout
style="@style/Form.SectionLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include
layout="@layout/form_section_ssh_tunnel"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
</LinearLayout>
</app.devlife.connect2sql.ui.widget.NotifyingScrollView>
<include
android:id="@+id/form_buttons"
layout="@layout/form_buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
<!-- Placed last to have greatest z-index value-->
<app.devlife.connect2sql.ui.connection.form.ActionBarContainer
android:id="@+id/form_actionbar"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
\ No newline at end of file
......@@ -20,7 +20,7 @@
<string name="form_action_help">Ayuda</string>
<string name="form_action_keyboard_input">Alternar entrada de teclado</string>
<string name="form_action_visible">Alternar visibilidad</string>
<string name="form_action_obscure">Alternar visibilidad</string>
<string name="form_advanced_options">Opciones Avanzadas</string>
<string name="form_connection_details">Detalles de Conexión</string>
<string name="form_error_database_required">Por favor, introduzca un nombre de base de datos.</string>
......
......@@ -28,7 +28,7 @@
<string name="form_action_help">Help</string>
<string name="form_action_keyboard_input">Toggle keyboard input</string>
<string name="form_action_visible">Toggle visibility</string>
<string name="form_action_obscure">Toggle visibility</string>
<string name="form_advanced_options">Advanced Options</string>
<string name="form_connection_details">Connection Details</string>
<string name="form_error_database_required">Please enter a database name.</string>
......@@ -70,8 +70,14 @@
<string name="help_password">Specify the password necessary to authenticate with against the server. If left empty, we will ask you every time you attempt to connect.</string>
<string name="help_port">Specify the port which your server is listening on.</string>
<string name="help_positive_btn_label">Okay, got it!</string>
<string name="help_ssh_host">Specify host of the SSH server to tunnel through.</string>
<string name="help_ssh_passphrase">Specify SSH passphrase of the private key provided.</string>
<string name="help_ssh_password">Specify SSH password for the SSH server to tunnel through.</string>
<string name="help_ssh_port">Specify port of the SSH server to tunnel through.</string>
<string name="help_ssh_private_key">Specify SSH private key to use for the SSH server to tunnel through.</string>
<string name="help_ssh_username">Specify SSH username for the SSH server to tunnel through.</string>
<string name="help_trust_cert">Bypass validation of certificate when using SSL.</string>
<string name="help_use_ssl">Specify whether the connection should be made over a secure connection. Note: SSL must be enabled and configured properly on your server.</string>
<string name="help_use_ssl">Specify whether the connection should be made over a secure connection.\n\nNote: SSL must be enabled and configured properly on the server.</string>
<string name="help_username">Specify the username necessary to authenticate with against the server.</string>
<string name="item_host_key_fingerprint_sample">00:00:00:00:00:00:00:00:00:00:00</string>
......
......@@ -83,9 +83,9 @@
<item name="type">help</item>
</style>
<style name="Form.Action.Visible">
<item name="android:src">@drawable/ic_form_visible</item>
<item name="android:contentDescription">@string/form_action_visible</item>
<style name="Form.Action.Obscure">
<item name="android:src">@drawable/ic_form_obscure</item>
<item name="android:contentDescription">@string/form_action_obscure</item>
<item name="type">obscure</item>
</style>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment