Skip to content

Commit

Permalink
Remove useless parent layout
Browse files Browse the repository at this point in the history
  • Loading branch information
abelgardep committed Dec 12, 2019
1 parent deba77c commit 35089bf
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
Expand Down Expand Up @@ -81,7 +81,7 @@ protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_pattern_lock);

// Allow or disallow touches with other visible windows
RelativeLayout activityPatternLockLayout = findViewById(R.id.activityPatternLockLayout);
LinearLayout activityPatternLockLayout = findViewById(R.id.activityPatternLockLayout);
activityPatternLockLayout.setFilterTouchesWhenObscured(
PreferenceUtils.shouldDisallowTouchesWithOtherVisibleWindows(this)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ public static CharSequence getRelativeTimestamp(Context context, long modificati
DateUtils.WEEK_IN_MILLIS, 0);
}

@SuppressWarnings("deprecation")
public static CharSequence getRelativeDateTimeString(
Context c, long time, long minResolution, long transitionResolution, int flags
) {
Expand Down
91 changes: 42 additions & 49 deletions owncloudApp/src/main/res/layout-land/activity_pattern_lock.xml
Original file line number Diff line number Diff line change
@@ -1,64 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activityPatternLockLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="vertical"
android:padding="@dimen/standard_padding">

<LinearLayout
<TextView
android:id="@+id/header_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center_horizontal"
android:orientation="vertical">
android:text="@string/pattern_enter_pattern"
android:textColor="@android:color/black"
android:textSize="16sp" />

<TextView
android:id="@+id/header_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pattern_enter_pattern"
android:textColor="@android:color/black"
android:textSize="16sp" />
<TextView
android:id="@+id/explanation_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/pattern_configure_your_pattern_explanation"
android:textAppearance="@android:style/TextAppearance.Small"
android:textSize="14sp" />

<TextView
android:id="@+id/explanation_pattern"
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<com.andrognito.patternlockview.PatternLockView
android:id="@+id/pattern_lock_view"
android:layout_width="250dp"
android:layout_height="250dp"
android:focusable="true"
app:correctStateColor="@color/primary"
app:dotCount="3"
app:normalStateColor="@color/primary"
app:wrongStateColor="@color/primary">

<requestFocus />
</com.andrognito.patternlockview.PatternLockView>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/pattern_configure_your_pattern_explanation"
android:textAppearance="@android:style/TextAppearance.Small"
android:textSize="14sp" />

<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content">

<com.andrognito.patternlockview.PatternLockView
android:id="@+id/pattern_lock_view"
android:layout_width="250dp"
android:layout_height="250dp"
android:focusable="true"
app:correctStateColor="@color/primary"
app:dotCount="3"
app:normalStateColor="@color/primary"
app:wrongStateColor="@color/primary">

<requestFocus />
</com.andrognito.patternlockview.PatternLockView>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/pattern_lock_view"
android:text="@android:string/cancel"
android:theme="@style/Button.Primary" />

</RelativeLayout>
android:layout_centerVertical="true"
android:layout_toEndOf="@id/pattern_lock_view"
android:text="@android:string/cancel"
android:theme="@style/Button.Primary" />

</LinearLayout>
</RelativeLayout>

</RelativeLayout>
</LinearLayout>
83 changes: 38 additions & 45 deletions owncloudApp/src/main/res/layout/activity_pattern_lock.xml
Original file line number Diff line number Diff line change
@@ -1,56 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activityPatternLockLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_horizontal"
android:layout_centerVertical="true"
android:gravity="center"
android:orientation="vertical"
android:padding="@dimen/standard_padding">

<LinearLayout
<TextView
android:id="@+id/header_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:gravity="center_horizontal"
android:orientation="vertical">

<TextView
android:id="@+id/header_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pattern_enter_pattern"
android:textColor="@android:color/black"
android:textSize="16sp" />

<TextView
android:id="@+id/explanation_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/pattern_configure_your_pattern_explanation"
android:textAppearance="@android:style/TextAppearance.Small"
android:textSize="14sp" />

<com.andrognito.patternlockview.PatternLockView
android:id="@+id/pattern_lock_view"
android:layout_width="280dp"
android:layout_height="280dp"
android:focusable="true"
app:correctStateColor="@color/primary"
app:dotCount="3"
app:normalStateColor="@color/primary"
app:wrongStateColor="@color/primary">

<requestFocus />
</com.andrognito.patternlockview.PatternLockView>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/cancel"
android:theme="@style/Button.Primary" />
android:text="@string/pattern_enter_pattern"
android:textColor="@android:color/black"
android:textSize="16sp" />

</LinearLayout>
<TextView
android:id="@+id/explanation_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="@string/pattern_configure_your_pattern_explanation"
android:textAppearance="@android:style/TextAppearance.Small"
android:textSize="14sp" />

<com.andrognito.patternlockview.PatternLockView
android:id="@+id/pattern_lock_view"
android:layout_width="280dp"
android:layout_height="280dp"
android:focusable="true"
app:correctStateColor="@color/primary"
app:dotCount="3"
app:normalStateColor="@color/primary"
app:wrongStateColor="@color/primary">

<requestFocus />
</com.andrognito.patternlockview.PatternLockView>

<androidx.appcompat.widget.AppCompatButton
android:id="@+id/cancel_pattern"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@android:string/cancel"
android:theme="@style/Button.Primary" />

</RelativeLayout>
</LinearLayout>

0 comments on commit 35089bf

Please sign in to comment.