mirror of
https://github.com/sudoxnym/habitica-android.git
synced 2026-05-24 06:35:46 +00:00
Update to new version of design library. Tabs on single line. Tuning for new version of design lib
This commit is contained in:
parent
550ee32baa
commit
3be1154d2d
5 changed files with 23 additions and 16 deletions
|
|
@ -50,10 +50,10 @@ dependencies {
|
|||
transitive = true
|
||||
}
|
||||
|
||||
compile 'com.android.support:appcompat-v7:22.2.1'
|
||||
compile 'com.android.support:design:22.2.1'
|
||||
compile 'com.android.support:gridlayout-v7:22.2.1'
|
||||
compile 'com.android.support:recyclerview-v7:22.2.1'
|
||||
compile 'com.android.support:appcompat-v7:23.0.1'
|
||||
compile 'com.android.support:design:23.0.1'
|
||||
compile 'com.android.support:gridlayout-v7:23.0.1'
|
||||
compile 'com.android.support:recyclerview-v7:23.0.1'
|
||||
|
||||
// Image Loading/Caching
|
||||
compile 'com.squareup.picasso:picasso:2.5.2'
|
||||
|
|
@ -89,9 +89,9 @@ dependencies {
|
|||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion 22
|
||||
compileSdkVersion 23
|
||||
//buildToolsVersion "23.0.0-rc2"
|
||||
buildToolsVersion "22.0.1"
|
||||
buildToolsVersion "23.0.1"
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="210dp"
|
||||
android:fitsSystemWindows="true"
|
||||
|
||||
app:titleEnabled="false"
|
||||
app:contentScrim="?attr/colorPrimary"
|
||||
app:expandedTitleMarginEnd="64dp"
|
||||
app:expandedTitleMarginStart="48dp"
|
||||
|
|
@ -67,8 +67,7 @@
|
|||
android:background="?attr/colorPrimary"
|
||||
android:elevation="0dp"
|
||||
android:fillViewport="false"
|
||||
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:theme="@style/MyCustomTabLayout"
|
||||
app:layout_anchor="@+id/collapsing_toolbar"
|
||||
app:layout_anchorGravity="bottom"
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,11 @@
|
|||
<item name="android:popupBackground">@color/brand_500</item>
|
||||
</style>
|
||||
|
||||
<style name="MyCustomTabLayout" parent="ThemeOverlay.AppCompat.Dark.ActionBar">
|
||||
<item name="android:singleLine">true</item>
|
||||
<item name="android:lines">1</item>
|
||||
<item name="android:ellipsize">end</item>
|
||||
</style>
|
||||
|
||||
|
||||
<style name="CardText">
|
||||
|
|
|
|||
|
|
@ -93,13 +93,13 @@ public abstract class AvatarActivityBase extends InstabugAppCompatActivity {
|
|||
avatarInHeader = new AvatarWithBarsViewModel(this, avatar_with_bars);
|
||||
|
||||
|
||||
titleTextView = new TextView(this);
|
||||
titleTextView.setTextAppearance(this, android.R.style.TextAppearance_Material_Widget_ActionBar_Title_Inverse);
|
||||
titleTextView.setPadding(0,16,0,0);
|
||||
toolbar.addView(titleTextView);
|
||||
// titleTextView = new TextView(this);
|
||||
// titleTextView.setTextAppearance(this, android.R.style.TextAppearance_Material_Widget_ActionBar_Title_Inverse);
|
||||
// titleTextView.setPadding(0,16,0,0);
|
||||
// toolbar.addView(titleTextView);
|
||||
}
|
||||
|
||||
protected void setTitle(String text){
|
||||
titleTextView.setText(text);
|
||||
toolbar.setTitle(text);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import android.support.design.widget.Snackbar;
|
|||
import android.support.design.widget.TabLayout;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentPagerAdapter;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
|
@ -116,7 +117,6 @@ public class MainActivity extends AvatarActivityBase implements HabitRPGUserCall
|
|||
|
||||
this.observer.addSpecificModelChangeListener(this);
|
||||
|
||||
SetUserData();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -128,6 +128,8 @@ public class MainActivity extends AvatarActivityBase implements HabitRPGUserCall
|
|||
|
||||
mAPIHelper.retrieveUser(new HabitRPGUserCallback(this));
|
||||
}
|
||||
SetUserData();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -401,7 +403,7 @@ public class MainActivity extends AvatarActivityBase implements HabitRPGUserCall
|
|||
case 2:
|
||||
return "Todos";
|
||||
case 3:
|
||||
return "Rewards";
|
||||
return "Rewardsahahahah";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
|
@ -541,6 +543,7 @@ public class MainActivity extends AvatarActivityBase implements HabitRPGUserCall
|
|||
loadTaskLists();
|
||||
FillTagFilterDrawer(User.getTags());
|
||||
}
|
||||
Log.w("header", "updating header");
|
||||
updateHeader();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue