Skip to content
Snippets Groups Projects
Commit 59b32b7b authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixed several bugs

parent 99250ae2
No related branches found
No related tags found
No related merge requests found
Showing
with 574 additions and 291 deletions
......@@ -29,7 +29,7 @@ import java.util.Set;
import de.kuschku.libquassel.syncables.types.interfaces.QNetwork;
import de.kuschku.util.observables.callbacks.UICallback;
import de.kuschku.util.observables.lists.ObservableSortedList;
import de.kuschku.util.observables.lists.AndroidObservableSortedList;
public class FakeNetworksWrapper {
private final QNetwork fakeNetwork;
......@@ -70,13 +70,13 @@ public class FakeNetworksWrapper {
notifyChanged();
}
};
private ObservableSortedList<QNetwork> base;
private AndroidObservableSortedList<QNetwork> base;
public FakeNetworksWrapper(Context context) {
this.fakeNetwork = new AllNetworksItem(context);
}
public void setBase(ObservableSortedList<QNetwork> base) {
public void setBase(AndroidObservableSortedList<QNetwork> base) {
if (this.base != null)
this.base.removeCallback(callback);
this.base = base;
......
/*
* QuasselDroid - Quassel client for Android
* Copyright (C) 2016 Janne Koschinski
* Copyright (C) 2016 Ken Børge Viktil
* Copyright (C) 2016 Magnus Fjell
* Copyright (C) 2016 Martin Sandsmark <martin.sandsmark@kde.org>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.util.observables.lists;
import android.support.annotation.NonNull;
import java.util.List;
import de.kuschku.util.observables.ContentComparable;
import de.kuschku.util.observables.callbacks.UICallback;
public class AndroidObservableComparableSortedList<T extends ContentComparable<T>> extends AndroidObservableSortedList<T> implements IObservableList<UICallback, T>, List<T> {
public AndroidObservableComparableSortedList(@NonNull Class<T> cl) {
super(cl, new SimpleItemComparator<>());
}
public AndroidObservableComparableSortedList(@NonNull Class<T> cl, boolean reverse) {
super(cl, new SimpleItemComparator<>(), reverse);
}
public static class SimpleItemComparator<T extends ContentComparable<T>> implements ItemComparator<T> {
@Override
public int compare(@NonNull T o1, @NonNull T o2) {
return o1.compareTo(o2);
}
@Override
public boolean areContentsTheSame(@NonNull T oldItem, @NonNull T newItem) {
return oldItem.areContentsTheSame(newItem);
}
@Override
public boolean areItemsTheSame(@NonNull T item1, @NonNull T item2) {
return item1.areItemsTheSame(item2);
}
}
}
/*
* QuasselDroid - Quassel client for Android
* Copyright (C) 2016 Janne Koschinski
* Copyright (C) 2016 Ken Børge Viktil
* Copyright (C) 2016 Magnus Fjell
* Copyright (C) 2016 Martin Sandsmark <martin.sandsmark@kde.org>
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package de.kuschku.util.observables.lists;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.util.SortedList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import de.kuschku.util.backports.Stream;
import de.kuschku.util.observables.callbacks.UICallback;
import de.kuschku.util.observables.callbacks.wrappers.MultiUICallbackWrapper;
import static de.kuschku.util.AndroidAssert.assertTrue;
@SuppressWarnings("unchecked")
public class AndroidObservableSortedList<T> implements IObservableList<UICallback, T> {
@NonNull
private final SortedList<T> list;
private final boolean reverse;
@NonNull
private final MultiUICallbackWrapper callback = MultiUICallbackWrapper.of();
@NonNull
private ItemComparator<T> comparator;
public AndroidObservableSortedList(@NonNull Class<T> cl, @NonNull ItemComparator<T> comparator) {
this(cl, comparator, false);
}
public AndroidObservableSortedList(@NonNull Class<T> cl, @NonNull ItemComparator<T> comparator, boolean reverse) {
this.list = new SortedList<>(cl, new Callback());
this.comparator = comparator;
this.reverse = reverse;
}
@Override
public void addCallback(@NonNull UICallback callback) {
this.callback.addCallback(callback);
}
@Override
public void removeCallback(@NonNull UICallback callback) {
this.callback.removeCallback(callback);
}
@Override
public void removeCallbacks() {
callback.removeCallbacks();
}
public void setComparator(@NonNull ItemComparator<T> comparator) {
this.comparator = comparator;
}
@Nullable
public T last() {
if (list.size() == 0) return null;
return list.get(list.size() - 1);
}
@Override
public void add(int location, T object) {
list.add(object);
}
@Override
public boolean add(T object) {
list.add(object);
return true;
}
@Override
public boolean addAll(int location, @NonNull Collection<? extends T> collection) {
list.addAll((Collection<T>) collection);
return true;
}
@Override
public boolean addAll(@NonNull Collection<? extends T> collection) {
list.addAll((Collection<T>) collection);
return false;
}
@Override
public void clear() {
list.clear();
}
@Override
public boolean contains(Object object) {
return indexOf(object) != SortedList.INVALID_POSITION;
}
@Override
public boolean containsAll(@NonNull Collection<?> collection) {
return new Stream<>(collection).allMatch(this::contains);
}
@Override
public T get(int location) {
return list.get(location);
}
@Override
public int indexOf(Object object) {
return list.indexOf((T) object);
}
@Override
public boolean isEmpty() {
return list.size() == 0;
}
@NonNull
@Override
public Iterator<T> iterator() {
return new CallbackedSortedListIterator();
}
@Override
public int lastIndexOf(Object object) {
return indexOf(object);
}
@NonNull
@Override
public ListIterator<T> listIterator() {
return new CallbackedSortedListIterator();
}
@NonNull
@Override
public ListIterator<T> listIterator(int location) {
return new CallbackedSortedListIterator(location);
}
@Nullable
@Override
public T remove(int location) {
T item = list.get(location);
list.remove(item);
return item;
}
@Override
public boolean remove(Object object) {
try {
list.remove((T) object);
return true;
} catch (ClassCastException e) {
return false;
}
}
@Override
public boolean removeAll(@NonNull Collection<?> collection) {
boolean result = true;
for (Object o : collection) {
result &= remove(o);
}
return result;
}
@Override
public boolean retainAll(@NonNull Collection<?> collection) {
return false;
}
@Nullable
@Override
public T set(int location, T object) {
return null;
}
@Override
public int size() {
return list.size();
}
@NonNull
@Override
public List<T> subList(int start, int end) {
assertTrue(start <= end);
assertTrue(start >= 0);
assertTrue(end <= list.size());
List<T> subList = new ArrayList<>(end - start);
for (int i = start; i < end; i++) {
subList.add(list.get(i));
}
return subList;
}
@NonNull
@Override
public Object[] toArray() {
Object[] array = new Object[list.size()];
for (int i = 0; i < list.size(); i++) {
array[i] = list.get(i);
}
return array;
}
@NonNull
@Override
public <T1> T1[] toArray(@NonNull T1[] a) {
try {
Object[] elements = toArray();
if (a.length < elements.length)
// Make a new array of a's runtime type, but my contents:
return (T1[]) Arrays.copyOf(elements, elements.length, a.getClass());
System.arraycopy(elements, 0, a, 0, elements.length);
if (a.length > elements.length)
a[elements.length] = null;
return a;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
public void notifyItemChanged(int position) {
T obj = get(position);
list.recalculatePositionOfItemAt(position);
callback.notifyItemChanged(indexOf(obj));
}
@NonNull
@Override
public String toString() {
return Arrays.toString(toArray());
}
public interface ItemComparator<T> {
int compare(T o1, T o2);
boolean areContentsTheSame(T oldItem, T newItem);
boolean areItemsTheSame(T item1, T item2);
}
class Callback extends SortedList.Callback<T> {
@Override
public int compare(T o1, T o2) {
return (reverse) ? comparator.compare(o2, o1) : comparator.compare(o1, o2);
}
@Override
public void onInserted(int position, int count) {
if (count == 1)
callback.notifyItemInserted(position);
else
callback.notifyItemRangeInserted(position, count);
}
@Override
public void onRemoved(int position, int count) {
if (count == 1)
callback.notifyItemRemoved(position);
else
callback.notifyItemRangeRemoved(position, count);
}
@Override
public void onMoved(int fromPosition, int toPosition) {
callback.notifyItemMoved(fromPosition, toPosition);
}
@Override
public void onChanged(int position, int count) {
if (count == 1)
callback.notifyItemChanged(position);
else
callback.notifyItemRangeChanged(position, count);
}
@Override
public boolean areContentsTheSame(T oldItem, T newItem) {
return comparator.areContentsTheSame(oldItem, newItem);
}
@Override
public boolean areItemsTheSame(T item1, T item2) {
return comparator.areItemsTheSame(item1, item2);
}
}
class CallbackedSortedListIterator implements Iterator<T>, ListIterator<T> {
int position;
public CallbackedSortedListIterator() {
this(0);
}
public CallbackedSortedListIterator(int position) {
this.position = position;
}
@Override
public void add(T object) {
list.add(object);
}
@Override
public boolean hasNext() {
return position < list.size();
}
@Override
public boolean hasPrevious() {
return position >= 0;
}
@Override
public T next() {
return list.get(position++);
}
@Override
public int nextIndex() {
return position + 1;
}
@Override
public T previous() {
return list.get(position--);
}
@Override
public int previousIndex() {
return position - 1;
}
@Override
public void remove() {
list.remove(list.get(position));
callback.notifyItemRemoved(position);
}
@Override
public void set(T object) {
list.remove(list.get(position));
list.add(object);
}
}
}
......@@ -30,16 +30,16 @@ import de.kuschku.util.observables.callbacks.UIParentCallback;
import de.kuschku.util.observables.callbacks.wrappers.MultiUIChildParentCallback;
import de.kuschku.util.observables.callbacks.wrappers.ParentUICallbackWrapper;
public class ChildParentObservableSortedList<T extends IObservable<UIChildCallback>> extends ObservableSortedList<T> {
public class ChildParentAndroidObservableSortedList<T extends IObservable<UIChildCallback>> extends AndroidObservableSortedList<T> {
@NonNull
private final MultiUIChildParentCallback callback = MultiUIChildParentCallback.of();
public ChildParentObservableSortedList(@NonNull Class<T> cl, @NonNull ItemComparator<T> comparator) {
public ChildParentAndroidObservableSortedList(@NonNull Class<T> cl, @NonNull ItemComparator<T> comparator) {
super(cl, comparator);
registerCallbacks();
}
public ChildParentObservableSortedList(@NonNull Class<T> cl, @NonNull ItemComparator<T> comparator, boolean reverse) {
public ChildParentAndroidObservableSortedList(@NonNull Class<T> cl, @NonNull ItemComparator<T> comparator, boolean reverse) {
super(cl, comparator, reverse);
registerCallbacks();
}
......
......@@ -21,38 +21,36 @@
package de.kuschku.util.observables.lists;
import android.support.annotation.NonNull;
import java.util.Comparator;
import java.util.List;
import de.kuschku.util.observables.ContentComparable;
import de.kuschku.util.observables.callbacks.UICallback;
public class ObservableComparableSortedList<T extends ContentComparable<T>> extends ObservableSortedList<T> implements IObservableList<UICallback, T>, List<T> {
public ObservableComparableSortedList(@NonNull Class<T> cl) {
super(cl, new SimpleItemComparator<>());
public class ObservableComparableSortedList<T extends Comparable<? super T>> extends ObservableSortedList<T> implements IObservableList<UICallback, T> {
public ObservableComparableSortedList() {
super(new ComparableComparator<>());
}
public ObservableComparableSortedList(@NonNull Class<T> cl, boolean reverse) {
super(cl, new SimpleItemComparator<>(), reverse);
public ObservableComparableSortedList(int capacity) {
super(new ComparableComparator<>(), capacity);
}
public static class SimpleItemComparator<T extends ContentComparable<T>> implements ItemComparator<T> {
public static class ComparableComparator<T extends Comparable<? super T>> implements Comparator<T> {
@Override
public int compare(@NonNull T o1, @NonNull T o2) {
public int compare(T o1, T o2) {
return o1.compareTo(o2);
}
}
@Override
public boolean areContentsTheSame(@NonNull T oldItem, @NonNull T newItem) {
return oldItem.areContentsTheSame(newItem);
public static class ItemComparatorWrapper<T> implements Comparator<T> {
private final AndroidObservableSortedList.ItemComparator<T> itemComparator;
public ItemComparatorWrapper(AndroidObservableSortedList.ItemComparator<T> itemComparator) {
this.itemComparator = itemComparator;
}
@Override
public boolean areItemsTheSame(@NonNull T item1, @NonNull T item2) {
return item1.areItemsTheSame(item2);
public int compare(T o1, T o2) {
return itemComparator.compare(o1, o2);
}
}
}
......@@ -22,49 +22,40 @@
package de.kuschku.util.observables.lists;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v7.util.SortedList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import de.kuschku.util.backports.Stream;
import de.kuschku.util.observables.callbacks.UICallback;
import de.kuschku.util.observables.callbacks.wrappers.MultiUICallbackWrapper;
import static de.kuschku.util.AndroidAssert.assertTrue;
@SuppressWarnings("unchecked")
public class ObservableSortedList<T> implements IObservableList<UICallback, T> {
@NonNull
private final SortedList<T> list;
private final boolean reverse;
public class ObservableSortedList<T> extends ArrayList<T> implements IObservableList<UICallback, T> {
@NonNull
private final MultiUICallbackWrapper callback = MultiUICallbackWrapper.of();
@NonNull
private ItemComparator<T> comparator;
public ObservableSortedList(@NonNull Class<T> cl, @NonNull ItemComparator<T> comparator) {
this(cl, comparator, false);
private final Comparator<T> comparator;
public ObservableSortedList(Comparator<T> comparator) {
super();
this.comparator = comparator;
}
public ObservableSortedList(@NonNull Class<T> cl, @NonNull ItemComparator<T> comparator, boolean reverse) {
this.list = new SortedList<>(cl, new Callback());
public ObservableSortedList(Comparator<T> comparator, int capacity) {
super(capacity);
this.comparator = comparator;
this.reverse = reverse;
}
@Override
public ObservableSortedList(AndroidObservableSortedList.ItemComparator<T> itemComparator) {
this.comparator = new ObservableComparableSortedList.ItemComparatorWrapper<>(itemComparator);
}
public void addCallback(@NonNull UICallback callback) {
this.callback.addCallback(callback);
}
@Override
public void removeCallback(@NonNull UICallback callback) {
this.callback.removeCallback(callback);
}
......@@ -74,299 +65,148 @@ public class ObservableSortedList<T> implements IObservableList<UICallback, T> {
callback.removeCallbacks();
}
public void setComparator(@NonNull ItemComparator<T> comparator) {
this.comparator = comparator;
}
private int getPosition(T key) {
int low = 0;
int high = size() - 1;
@Nullable
public T last() {
if (list.size() == 0) return null;
while (low <= high) {
int mid = (low + high) >>> 1;
T midVal = get(mid);
int cmp = comparator.compare(midVal, key);
return list.get(list.size() - 1);
if (cmp < 0)
low = mid + 1;
else if (cmp > 0)
high = mid - 1;
else
return -1; // key found
}
@Override
public void add(int location, T object) {
list.add(object);
return low; // key not found
}
@Override
public boolean add(T object) {
list.add(object);
return true;
}
@Override
public boolean addAll(int location, @NonNull Collection<? extends T> collection) {
list.addAll((Collection<T>) collection);
return true;
}
@Override
public boolean addAll(@NonNull Collection<? extends T> collection) {
list.addAll((Collection<T>) collection);
return false;
}
@Override
public void clear() {
list.clear();
}
@Override
public boolean contains(Object object) {
return indexOf(object) != SortedList.INVALID_POSITION;
}
@Override
public boolean containsAll(@NonNull Collection<?> collection) {
return new Stream<>(collection).allMatch(this::contains);
}
@Override
public T get(int location) {
return list.get(location);
}
@Override
public int indexOf(Object object) {
return list.indexOf((T) object);
int position = addInternal(object);
callback.notifyItemInserted(position);
return position != -1;
}
@Override
public boolean isEmpty() {
return list.size() == 0;
public int addInternal(T object) {
int position = getPosition(object);
if (position != -1) super.add(position, object);
return position;
}
@NonNull
@Override
public Iterator<T> iterator() {
return new CallbackedSortedListIterator();
public void add(int index, T object) {
add(object);
}
@Override
public int lastIndexOf(Object object) {
return indexOf(object);
public boolean addAll(@NonNull Collection<? extends T> collection) {
boolean addedAny = false;
for (T t : collection) {
addedAny |= add(t);
}
@NonNull
@Override
public ListIterator<T> listIterator() {
return new CallbackedSortedListIterator();
return addedAny;
}
@NonNull
@Override
public ListIterator<T> listIterator(int location) {
return new CallbackedSortedListIterator(location);
public boolean addAll(int index, @NonNull Collection<? extends T> collection) {
return addAll(collection);
}
@Nullable
@Override
public T remove(int location) {
T item = list.get(location);
list.remove(item);
return item;
public T remove(int index) {
T result = super.remove(index);
callback.notifyItemRemoved(index);
return result;
}
@Override
public boolean remove(Object object) {
try {
list.remove((T) object);
return true;
} catch (ClassCastException e) {
int position = indexOf(object);
if (position == -1) {
return false;
} else {
remove(position);
return true;
}
}
@Override
public boolean removeAll(@NonNull Collection<?> collection) {
boolean result = true;
for (Object o : collection) {
result &= remove(o);
}
return result;
}
@Override
public boolean retainAll(@NonNull Collection<?> collection) {
return false;
protected void removeRange(int fromIndex, int toIndex) {
super.removeRange(fromIndex, toIndex);
callback.notifyItemRangeRemoved(fromIndex, toIndex - fromIndex);
}
@Nullable
@Override
public T set(int location, T object) {
return null;
public int indexOf(Object object) {
return Collections.binarySearch(this, (T) object, comparator);
}
@Override
public int size() {
return list.size();
public int lastIndexOf(Object object) {
return Collections.binarySearch(this, (T) object, comparator);
}
@NonNull
@Override
public List<T> subList(int start, int end) {
assertTrue(start <= end);
assertTrue(start >= 0);
assertTrue(end <= list.size());
List<T> subList = new ArrayList<>(end - start);
for (int i = start; i < end; i++) {
subList.add(list.get(i));
}
return subList;
public void clear() {
int size = size();
super.clear();
callback.notifyItemRangeRemoved(0, size);
}
@NonNull
@Override
public Object[] toArray() {
Object[] array = new Object[list.size()];
for (int i = 0; i < list.size(); i++) {
array[i] = list.get(i);
}
return array;
public T set(int index, T element) {
T set = super.set(index, element);
notifyItemChanged(element);
callback.notifyItemChanged(index);
return set;
}
@NonNull
@Override
public <T1> T1[] toArray(@NonNull T1[] a) {
try {
Object[] elements = toArray();
if (a.length < elements.length)
// Make a new array of a's runtime type, but my contents:
return (T1[]) Arrays.copyOf(elements, elements.length, a.getClass());
System.arraycopy(elements, 0, a, 0, elements.length);
if (a.length > elements.length)
a[elements.length] = null;
return a;
} catch (Exception e) {
throw new RuntimeException(e);
public void notifyItemChanged(T element) {
int index = super.indexOf(element);
super.remove(index);
int position = getPosition(element);
if (position != index) {
callback.notifyItemRemoved(index);
add(position, element);
} else {
super.add(index, element);
callback.notifyItemChanged(index);
}
}
public void notifyItemChanged(int position) {
T obj = get(position);
list.recalculatePositionOfItemAt(position);
callback.notifyItemChanged(indexOf(obj));
}
@NonNull
@Override
public String toString() {
return Arrays.toString(toArray());
}
public interface ItemComparator<T> {
int compare(T o1, T o2);
boolean areContentsTheSame(T oldItem, T newItem);
boolean areItemsTheSame(T item1, T item2);
}
class Callback extends SortedList.Callback<T> {
@Override
public int compare(T o1, T o2) {
return (reverse) ? comparator.compare(o2, o1) : comparator.compare(o1, o2);
}
@Override
public void onInserted(int position, int count) {
if (count == 1)
callback.notifyItemInserted(position);
else
callback.notifyItemRangeInserted(position, count);
}
@Override
public void onRemoved(int position, int count) {
if (count == 1)
callback.notifyItemRemoved(position);
else
callback.notifyItemRangeRemoved(position, count);
}
@Override
public void onMoved(int fromPosition, int toPosition) {
callback.notifyItemMoved(fromPosition, toPosition);
}
@Override
public void onChanged(int position, int count) {
if (count == 1)
callback.notifyItemChanged(position);
else
callback.notifyItemRangeChanged(position, count);
}
@Override
public boolean areContentsTheSame(T oldItem, T newItem) {
return comparator.areContentsTheSame(oldItem, newItem);
}
@Override
public boolean areItemsTheSame(T item1, T item2) {
return comparator.areItemsTheSame(item1, item2);
}
}
class CallbackedSortedListIterator implements Iterator<T>, ListIterator<T> {
int position;
public CallbackedSortedListIterator() {
this(0);
public Iterator<T> iterator() {
return new CallbackedArrayListIterator<>(super.iterator());
}
public CallbackedSortedListIterator(int position) {
this.position = position;
}
class CallbackedArrayListIterator<E> implements Iterator<E> {
final Iterator<E> iterator;
int position = 0;
@Override
public void add(T object) {
list.add(object);
public CallbackedArrayListIterator(Iterator<E> iterator) {
this.iterator = iterator;
}
@Override
public boolean hasNext() {
return position < list.size();
return iterator.hasNext();
}
@Override
public boolean hasPrevious() {
return position >= 0;
}
@Override
public T next() {
return list.get(position++);
}
@Override
public int nextIndex() {
return position + 1;
}
@Override
public T previous() {
return list.get(position--);
}
@Override
public int previousIndex() {
return position - 1;
public E next() {
position++;
return iterator.next();
}
@Override
public void remove() {
list.remove(list.get(position));
iterator.remove();
callback.notifyItemRemoved(position);
}
@Override
public void set(T object) {
list.remove(list.get(position));
list.add(object);
}
}
}
......@@ -23,6 +23,7 @@
<LinearLayout
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">
......@@ -36,7 +37,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -20,6 +20,7 @@
-->
<LinearLayout 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">
......@@ -33,7 +34,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -37,7 +37,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -36,7 +36,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -23,6 +23,7 @@
<LinearLayout
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">
......@@ -36,7 +37,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -37,7 +37,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -37,7 +37,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -36,7 +36,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -37,7 +37,8 @@
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"/>
android:layout_height="?attr/actionBarSize"
app:contentInsetStartWithNavigation="0dp"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -24,7 +24,8 @@
android:layout_height="match_parent"
android:orientation="vertical">
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.AppBarLayout
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="wrap_content"
......@@ -35,6 +36,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStartWithNavigation="0dp"
app:popupTheme="@style/AppTheme.PopupOverlay"/>
</android.support.design.widget.AppBarLayout>
......
......@@ -32,6 +32,7 @@
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:contentInsetStartWithNavigation="0dp"
app:popupTheme="@style/AppTheme.PopupOverlay">
<LinearLayout
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment