Commit 2e9f5035 authored by Rafael Kellermann Streit's avatar Rafael Kellermann Streit Committed by GitHub

Merge pull request #341 from filipedelimabrito/develop

Layout improvements.
parents b968f97a f6b711da
......@@ -2,12 +2,52 @@
language: android
jdk: oraclejdk8
sudo: required
android:
components: # Cookbooks version: https://github.com/travis-ci/travis-cookbooks/tree/9c6cd11
- tools # Update preinstalled tools from revision 24.0.2 to 24.4.1
- build-tools-25.0.3 # Match build-tools version used in build.gradle
- platform-tools # Update platform-tools to revision 25.0.3+
- tools # Update tools from revision 24.4.1 to 25.2.5
env:
global:
- API=26 # Android API level 26 by default
- TAG=google_apis # Google APIs by default, alternatively use default
- ABI=armeabi-v7a # ARM ABI v7a by default
- QEMU_AUDIO_DRV=none # Disable emulator audio to avoid warning
- ANDROID_HOME=/usr/local/android-sdk # Depends on the cookbooks version used in the VM
- TOOLS=${ANDROID_HOME}/tools # PATH order matters, exists more than one emulator script
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
- ADB_INSTALL_TIMEOUT=20 # minutes (2 minutes by default)
install:
# List and delete unnecessary components to free space
- sdkmanager --list || true
- sdkmanager --uninstall "system-images;android-15;default;armeabi-v7a"
# Update sdk tools to latest version and install/update components
- echo yes | sdkmanager "tools"
- echo yes | sdkmanager "platforms;android-26" # Latest platform required by SDK tools
- echo yes | sdkmanager "platforms;android-${API}" # Android platform required by emulator
- echo yes | sdkmanager "extras;android;m2repository"
- echo yes | sdkmanager "extras;google;m2repository"
- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
# - echo yes | sdkmanager "$EMULATOR" # Install emulator system image
# Create and start emulator
# - echo no | avdmanager create avd -n acib -k "$EMULATOR" -f --abi "$ABI" --tag "$TAG"
# - emulator -avd acib -engine classic -no-window -verbose -qemu -m 512 &
before_script:
- echo y | android update sdk --no-ui --all --filter tools,platform-tools
- echo y | android update sdk --no-ui --all --filter android-25
- echo y | android update sdk --no-ui --all --filter extra-android-m2repository,extra-android-support
- echo y | android update sdk --no-ui --all --filter extra-google-m2repository,extra-google-google_play_services
- echo y | android update sdk --no-ui --all --filter build-tools-25.0.3
# - echo y | android update sdk --no-ui --all --filter tools,platform-tools
# - echo y | android update sdk --no-ui --all --filter android-25
# - echo y | android update sdk --no-ui --all --filter extra-android-m2repository,extra-android-support
# - echo y | android update sdk --no-ui --all --filter extra-google-m2repository,extra-google-google_play_services
# - echo y | android update sdk --no-ui --all --filter build-tools-25.0.3
# - echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
# - echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
- ./gradlew dependencies
script:
......
......@@ -13,8 +13,8 @@ buildscript {
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
......@@ -22,7 +22,7 @@ android {
}
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "0.0.8"
}
......@@ -34,18 +34,14 @@ android {
}
}
ext {
supportVersion = '25.3.1'
}
dependencies {
compile project(':log-wrapper')
compile "com.android.support:support-annotations:$supportVersion"
compile "com.android.support:support-annotations:$rootProject.ext.supportLibraryVersion"
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'com.parse.bolts:bolts-tasks:1.4.0'
}
}
\ No newline at end of file
......@@ -27,12 +27,12 @@ buildscript {
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "chat.rocket.android"
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 25
versionName "1.0.15"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
......@@ -75,7 +75,6 @@ play {
}
ext {
supportVersion = '25.3.1'
playLibVersion = '10.2.6'
stethoVersion = '1.4.2'
rxbindingVersion = '2.0.0'
......@@ -91,8 +90,11 @@ dependencies {
compile project(':rocket-chat-android-widgets')
compile project(':persistence-realm')
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:design:$supportVersion"
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:design:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:support-annotations:$rootProject.ext.supportLibraryVersion"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:multidex:1.0.1'
......@@ -124,8 +126,6 @@ dependencies {
compile "com.github.hotchemi:permissionsdispatcher:$permissionsdispatcherVersion"
annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:$permissionsdispatcherVersion"
compile "com.android.support:support-annotations:$supportVersion"
}
apply plugin: 'com.google.gms.google-services'
......@@ -3,10 +3,10 @@ package chat.rocket.android.fragment.add_server;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.constraint.ConstraintLayout;
import android.support.design.widget.Snackbar;
import android.view.View;
import android.widget.TextView;
import chat.rocket.android.BuildConfig;
import chat.rocket.android.LaunchUtil;
import chat.rocket.android.R;
......@@ -21,6 +21,7 @@ import chat.rocket.android.service.ConnectivityManager;
public class InputHostnameFragment extends AbstractFragment implements InputHostnameContract.View {
private InputHostnameContract.Presenter presenter;
private ConstraintLayout container;
private View waitingView;
public InputHostnameFragment() {}
......@@ -29,11 +30,8 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
final Context appContext = getContext().getApplicationContext();
presenter = new InputHostnamePresenter(
new RocketChatCache(appContext),
ConnectivityManager.getInstance(appContext));
Context appContext = getContext().getApplicationContext();
presenter = new InputHostnamePresenter(new RocketChatCache(appContext), ConnectivityManager.getInstance(appContext));
}
@Override
......@@ -45,6 +43,7 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
protected void onSetupView() {
setupVersionInfo();
container = (ConstraintLayout) rootView.findViewById(R.id.container);
waitingView = rootView.findViewById(R.id.waiting);
rootView.findViewById(R.id.btn_connect).setOnClickListener(view -> handleConnect());
}
......@@ -82,14 +81,14 @@ public class InputHostnameFragment extends AbstractFragment implements InputHost
@Override
public void showLoader() {
rootView.findViewById(R.id.btn_connect).setEnabled(false);
container.setVisibility(View.GONE);
waitingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoader() {
rootView.findViewById(R.id.btn_connect).setEnabled(true);
waitingView.setVisibility(View.GONE);
container.setVisibility(View.VISIBLE);
}
@Override
......
......@@ -2,6 +2,7 @@ package chat.rocket.android.fragment.server_config;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.constraint.ConstraintLayout;
import android.support.design.widget.Snackbar;
import android.support.v4.app.Fragment;
import android.view.View;
......@@ -23,8 +24,7 @@ import chat.rocket.persistence.realm.repositories.RealmPublicSettingRepository;
public class LoginFragment extends AbstractServerConfigFragment implements LoginContract.View {
private LoginContract.Presenter presenter;
private View btnEmail;
private ConstraintLayout container;
private View waitingView;
private TextView txtUsername;
private TextView txtPasswd;
......@@ -47,7 +47,9 @@ public class LoginFragment extends AbstractServerConfigFragment implements Login
@Override
protected void onSetupView() {
btnEmail = rootView.findViewById(R.id.btn_login_with_email);
container = (ConstraintLayout) rootView.findViewById(R.id.container);
View btnEmail = rootView.findViewById(R.id.btn_login_with_email);
txtUsername = (TextView) rootView.findViewById(R.id.editor_username);
txtPasswd = (TextView) rootView.findViewById(R.id.editor_passwd);
waitingView = rootView.findViewById(R.id.waiting);
......@@ -62,14 +64,14 @@ public class LoginFragment extends AbstractServerConfigFragment implements Login
@Override
public void showLoader() {
btnEmail.setEnabled(false);
container.setVisibility(View.GONE);
waitingView.setVisibility(View.VISIBLE);
}
@Override
public void hideLoader() {
btnEmail.setEnabled(true);
waitingView.setVisibility(View.GONE);
container.setVisibility(View.VISIBLE);
}
@Override
......
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/white"/>
<corners android:radius="5dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
android:background="?attr/colorPrimaryDark"
tools:context="chat.rocket.android.fragment.add_server.InputHostnameFragment">
<android.support.constraint.ConstraintLayout 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"
android:background="?attr/colorPrimaryDark"
android:padding="@dimen/margin_8"
tools:context="chat.rocket.android.fragment.add_server.InputHostnameFragment">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:minWidth="288dp"
android:padding="@dimen/margin_24"
android:background="@color/white"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:id="@+id/container"
android:layout_width="wrap_content"
android:minWidth="288dp"
android:layout_height="wrap_content"
android:padding="@dimen/margin_24"
android:background="@drawable/container_bg"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@+id/version_info"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:text="@string/fragment_input_hostname_hostname"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
<EditText
android:id="@+id/editor_hostname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/fragment_input_hostname_server_hint"
android:imeOptions="actionGo"
android:inputType="textWebEditText"
android:singleLine="true" />
</LinearLayout>
<TextView
android:id="@+id/hostnameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingStart="4dp"
android:paddingLeft="4dp"
android:text="@string/fragment_input_hostname_hostname"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="@+id/editor_hostname"
app:layout_constraintBottom_toTopOf="@+id/editor_hostname" />
<Space
android:layout_width="@dimen/margin_16"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/editor_hostname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/fragment_input_hostname_server_hint"
android:imeOptions="actionSend"
android:inputType="textWebEditText"
android:maxLines="1"
app:layout_constraintTop_toBottomOf="@+id/hostnameTextView"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/btn_connect" />
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_connect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="end|bottom"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp" />
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/btn_connect"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:elevation="2dp"
app:fabSize="mini"
app:srcCompat="@drawable/ic_arrow_forward_white_24dp"
app:layout_constraintBottom_toBottomOf="@+id/editor_hostname"
app:layout_constraintLeft_toRightOf="@+id/editor_hostname"
app:layout_constraintRight_toRightOf="parent" />
</android.support.constraint.ConstraintLayout>
<chat.rocket.android.widget.WaitingView
android:id="@+id/waiting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/margin_16"
android:layout_gravity="center"
android:visibility="gone"/>
</LinearLayout>
<chat.rocket.android.widget.WaitingView
android:id="@+id/waiting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/version_info"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"/>
<TextView
android:id="@+id/version_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:layout_margin="@dimen/margin_8"
android:textColor="@android:color/white"
android:textAppearance="@style/TextAppearance.AppCompat.Caption" />
</FrameLayout>
\ No newline at end of file
<TextView
android:id="@+id/version_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/white"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
This diff is collapsed.
......@@ -9,9 +9,20 @@ allprojects {
maven { url 'http://dl.bintray.com/amulyakhare/maven' } //for TextDrawable.
maven { url "https://clojars.org/repo/" } //for icepick.
maven { url 'https://jitpack.io' } //for widget-fontawesome.
maven { url "https://maven.google.com" } // for Support Library.
}
}
// This block encapsulates custom properties and makes them available to all modules in the project.
// You can also create properties to specify versions for dependencies.
// Having consistent versions between modules can avoid conflicts with behavior.
ext {
compileSdkVersion = 26
targetSdkVersion = 26
buildToolsVersion = "26.0.0"
supportLibraryVersion = "25.4.0"
}
task clean(type: Delete) {
delete rootProject.buildDir
}
\ No newline at end of file
......@@ -10,12 +10,12 @@ buildscript {
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1"
}
......
......@@ -17,8 +17,8 @@ buildscript {
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
......@@ -26,7 +26,7 @@ android {
}
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1"
}
......@@ -38,17 +38,13 @@ android {
}
}
ext {
supportVersion = '25.3.1'
}
dependencies {
compile project(':log-wrapper')
compile project(':rocket-chat-core')
compile "com.android.support:support-annotations:$supportVersion"
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:design:$supportVersion"
compile "com.android.support:support-annotations:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:design:$rootProject.ext.supportLibraryVersion"
compile 'io.reactivex.rxjava2:rxjava:2.1.0'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
......
......@@ -10,12 +10,12 @@ buildscript {
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.3'
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1"
......@@ -30,7 +30,6 @@ android {
}
ext {
supportVersion = '25.3.1'
frescoVersion = '1.3.0'
rxbindingVersion = '2.0.0'
}
......@@ -38,12 +37,12 @@ ext {
dependencies {
compile project(':rocket-chat-core')
compile "com.android.support:support-annotations:$supportVersion"
compile "com.android.support:appcompat-v7:$supportVersion"
compile "com.android.support:recyclerview-v7:$supportVersion"
compile "com.android.support:cardview-v7:$supportVersion"
compile "com.android.support:support-v13:$supportVersion"
compile "com.android.support:design:$supportVersion"
compile "com.android.support:support-annotations:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:recyclerview-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:cardview-v7:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:support-v13:$rootProject.ext.supportLibraryVersion"
compile "com.android.support:design:$rootProject.ext.supportLibraryVersion"
compile 'org.nibor.autolink:autolink:0.6.0'
......
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