Skip to content

Commit

Permalink
fix align PlaceHolder without navigation icon
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel163 committed Jul 10, 2017
1 parent f5eb547 commit 4f139ea
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 20 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.3"

defaultConfig {
applicationId "com.mancj.example"
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 25
versionCode 2
versionName "1.1"
}
Expand All @@ -24,5 +24,5 @@ dependencies {
compile project(':library')
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
testCompile 'junit:junit:4.12'
// testCompile 'junit:junit:4.12'
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:2.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 12 09:35:06 CAT 2016
#Mon Jul 10 11:00:23 MSK 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
14 changes: 7 additions & 7 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.3"

defaultConfig {
minSdkVersion 16
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "0.1"
}
Expand All @@ -20,10 +20,10 @@ android {

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:recyclerview-v7:23.4.0'
compile 'com.android.support:cardview-v7:23.4.0'
// testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
}

// build a jar with source files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,14 +440,21 @@ public void setNavButtonEnabled(boolean navButtonEnabled) {
if (navButtonEnabled){
navIcon.setVisibility(VISIBLE);
navIcon.setClickable(true);
LayoutParams lp = (LayoutParams) inputContainer.getLayoutParams();
lp.leftMargin = (int) (50 * destiny);
inputContainer.setLayoutParams(lp);
navIcon.getLayoutParams().width = (int) (50 * destiny);

((LayoutParams) inputContainer.getLayoutParams()).leftMargin = (int) (50 * destiny);
arrowIcon.setVisibility(GONE);
}else {
navIcon.setVisibility(GONE);
navIcon.getLayoutParams().width = 1;
navIcon.setVisibility(INVISIBLE);
navIcon.setClickable(false);

((LayoutParams) inputContainer.getLayoutParams()).leftMargin = (int) (0 * destiny);
arrowIcon.setVisibility(VISIBLE);
}
navIcon.requestLayout();
placeHolder.requestLayout();
arrowIcon.requestLayout();
}

/**
Expand Down
3 changes: 1 addition & 2 deletions library/src/main/res/layout/searchbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:id="@+id/root"
Expand Down Expand Up @@ -57,7 +56,7 @@
android:textColor="@color/material_grey_600"
android:textStyle="bold"
android:visibility="visible"
tools:text="Hara haza mettig d1alocurg yu. Hara haza mettig d1alocurg yu. Hara haza mettig d1alocurg yu" />
tools:text="Hara" />

<LinearLayout
android:id="@+id/inputContainer"
Expand Down
2 changes: 2 additions & 0 deletions library/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
<dimen name="activity_horizontal_margin">16dp</dimen>
<dimen name="activity_vertical_margin">16dp</dimen>
<dimen name="fab_margin">16dp</dimen>

<dimen name="icon_size">50dp</dimen>
</resources>

0 comments on commit 4f139ea

Please sign in to comment.