updated featured graphics

fixed ui error on pre-lollipop devices
This commit is contained in:
Mariotaku Lee 2016-12-16 21:02:41 +08:00
parent 2e3358db54
commit 34eee52089
16 changed files with 55 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -28,7 +28,6 @@ import android.os.Bundle
import android.support.annotation.DrawableRes
import android.support.annotation.XmlRes
import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v7.app.AlertDialog
import android.support.v7.preference.Preference
import android.support.v7.preference.PreferenceFragmentCompat
@ -211,7 +210,7 @@ class SettingsActivity : BaseActivity(), OnItemClickListener, OnPreferenceStartF
if (isFinishing) return
val entry = entriesAdapter.getItem(position) as? PreferenceEntry ?: return
val fm = supportFragmentManager
fm.popBackStack(null, FragmentManager.POP_BACK_STACK_INCLUSIVE)
fm.popBackStackImmediate(null, 0)
val ft = fm.beginTransaction()
if (entry.preference != 0) {
val args = Bundle()

View File

@ -0,0 +1,44 @@
package org.mariotaku.twidere.view
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import org.mariotaku.twidere.R
/**
* Created by mariotaku on 2016/12/16.
*/
class AccountDashboardHeaderView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null
) : ViewGroup(context, attrs) {
private var sizeMeasurementId: Int
init {
val a = context.obtainStyledAttributes(attrs, R.styleable.AccountDashboardHeaderView)
sizeMeasurementId = a.getResourceId(R.styleable.AccountDashboardHeaderView_sizeMeasurementId, 0)
a.recycle()
}
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
val children: List<View> = (0 until childCount).map { getChildAt(it) }
val sizeMeasurementView = children.find { it.id == sizeMeasurementId }!!
measureChild(sizeMeasurementView, widthMeasureSpec, heightMeasureSpec)
children.forEach { child ->
if (child.id != sizeMeasurementId) {
measureChild(child, MeasureSpec.makeMeasureSpec(sizeMeasurementView.measuredWidth, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(sizeMeasurementView.measuredHeight, MeasureSpec.EXACTLY))
}
}
setMeasuredDimension(sizeMeasurementView.measuredWidth, sizeMeasurementView.measuredHeight)
}
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
(0 until childCount).forEach {
getChildAt(it).layout(0, 0, r - l, b - t)
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -22,15 +22,15 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:padding="@dimen/element_spacing_small"
tools:layout_height="48dp">
<org.mariotaku.twidere.view.ProfileImageView
android:id="@android:id/icon"
style="?profileImageStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
app:sivBorder="true"
app:sivBorderWidth="1.5dp"

View File

@ -17,7 +17,7 @@
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<RelativeLayout
<org.mariotaku.twidere.view.AccountDashboardHeaderView
android:id="@+id/accountDashboardHeader"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
@ -25,6 +25,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:descendantFocusability="blocksDescendants"
app:sizeMeasurementId="@+id/profileContainer"
tools:layout_height="160dp"
tools:layout_width="280dp">
@ -70,7 +71,7 @@
<org.mariotaku.twidere.view.ExtendedViewPager
android:id="@+id/otherAccountsList"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="52dp"
android:layout_alignBottom="@id/profileImage"
android:layout_alignTop="@id/profileImage"
android:layout_marginBottom="@dimen/element_spacing_large"
@ -201,4 +202,4 @@
</FrameLayout>
</RelativeLayout>
</org.mariotaku.twidere.view.AccountDashboardHeaderView>

View File

@ -127,6 +127,9 @@
<attr name="android:foreground"/>
<attr name="android:foregroundGravity"/>
</declare-styleable>
<declare-styleable name="AccountDashboardHeaderView">
<attr name="sizeMeasurementId" format="reference"/>
</declare-styleable>
<attr name="notificationType">
<flag name="none" value="0"/>
<flag name="ringtone" value="1"/>