fixed crash while clicked on pinned status
This commit is contained in:
parent
7a6c5e95bc
commit
ada7965a75
|
@ -1,5 +1,6 @@
|
|||
package org.mariotaku.microblog.library.twitter;
|
||||
|
||||
import org.mariotaku.microblog.library.twitter.api.PrivateAccountResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.PrivateActivityResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.PrivateDirectMessagesResources;
|
||||
import org.mariotaku.microblog.library.twitter.api.PrivateFriendsFollowersResources;
|
||||
|
@ -12,5 +13,5 @@ import org.mariotaku.microblog.library.twitter.api.PrivateTweetResources;
|
|||
*/
|
||||
public interface TwitterPrivate extends PrivateActivityResources, PrivateTweetResources,
|
||||
PrivateTimelineResources, PrivateFriendsFollowersResources, PrivateDirectMessagesResources,
|
||||
PrivateSearchResources {
|
||||
PrivateSearchResources, PrivateAccountResources {
|
||||
}
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
package org.mariotaku.microblog.library.twitter.api;
|
||||
|
||||
import org.mariotaku.microblog.library.MicroBlogException;
|
||||
import org.mariotaku.microblog.library.twitter.model.PinTweetResult;
|
||||
import org.mariotaku.restfu.annotation.method.POST;
|
||||
import org.mariotaku.restfu.annotation.param.Param;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 16/8/20.
|
||||
*/
|
||||
public interface PrivateAccountResources extends PrivateResources {
|
||||
|
||||
@POST("/account/pin_tweet.json")
|
||||
PinTweetResult pinTweet(@Param("id") String id) throws MicroBlogException;
|
||||
|
||||
@POST("/account/unpin_tweet.json")
|
||||
PinTweetResult unpinTweet(@Param("id") String id) throws MicroBlogException;
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.mariotaku.microblog.library.twitter.model;
|
||||
|
||||
import com.bluelinelabs.logansquare.annotation.JsonField;
|
||||
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 16/8/20.
|
||||
*/
|
||||
@JsonObject
|
||||
public class PinTweetResult {
|
||||
@JsonField(name = "pinned_tweets")
|
||||
String[] pinnedTweets;
|
||||
|
||||
public String[] getPinnedTweets() {
|
||||
return pinnedTweets;
|
||||
}
|
||||
}
|
|
@ -168,6 +168,9 @@ dependencies {
|
|||
compile 'com.github.mariotaku.CommonsLibrary:parcel:0.9.8'
|
||||
compile 'com.github.mariotaku.CommonsLibrary:io:0.9.8'
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
compile 'nl.komponents.kovenant:kovenant:3.3.0'
|
||||
compile 'nl.komponents.kovenant:kovenant-android:3.3.0'
|
||||
compile 'nl.komponents.kovenant:kovenant-functional:3.3.0'
|
||||
}
|
||||
|
||||
task svgToDrawable(type: SvgDrawableTask) {
|
||||
|
|
|
@ -9,7 +9,7 @@ import android.view.View
|
|||
import android.view.View.OnClickListener
|
||||
import android.view.View.OnLongClickListener
|
||||
import android.widget.ImageView
|
||||
import kotlinx.android.synthetic.main.card_item_status_compact.view.*
|
||||
import kotlinx.android.synthetic.main.list_item_status.view.*
|
||||
import org.mariotaku.twidere.Constants
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.adapter.iface.IStatusesAdapter
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package org.mariotaku.ktextension
|
||||
|
||||
import android.support.v7.widget.RecyclerView
|
||||
|
||||
/**
|
||||
* Created by mariotaku on 16/8/21.
|
||||
*/
|
||||
fun RecyclerView.Adapter<*>.findPositionByItemId(itemId: Long): Int {
|
||||
for (i in 0 until itemCount) {
|
||||
if (getItemId(i) == itemId) return i
|
||||
}
|
||||
return RecyclerView.NO_POSITION
|
||||
}
|
|
@ -166,21 +166,13 @@ open class BaseActivity : ATEActivity(), Constants, IExtendedActivity, IThemedAc
|
|||
val linkIntent = Intent(this, WebLinkHandlerActivity::class.java)
|
||||
val intent = PendingIntent.getActivity(this, 0, linkIntent, 0)
|
||||
val intentFilter = IntentFilter(NfcAdapter.ACTION_NDEF_DISCOVERED)
|
||||
run {
|
||||
var i = 0
|
||||
val j = handlerFilter.countDataSchemes()
|
||||
while (i < j) {
|
||||
intentFilter.addDataScheme(handlerFilter.getDataScheme(i))
|
||||
i++
|
||||
}
|
||||
for (i in 0 until handlerFilter.countDataSchemes()) {
|
||||
intentFilter.addDataScheme(handlerFilter.getDataScheme(i))
|
||||
}
|
||||
var i = 0
|
||||
val j = handlerFilter.countDataAuthorities()
|
||||
while (i < j) {
|
||||
for (i in 0 until handlerFilter.countDataAuthorities()) {
|
||||
val authorityEntry = handlerFilter.getDataAuthority(i)
|
||||
val port = authorityEntry.port
|
||||
intentFilter.addDataAuthority(authorityEntry.host, if (port < 0) null else Integer.toString(port))
|
||||
i++
|
||||
}
|
||||
try {
|
||||
adapter.enableForegroundDispatch(this, intent, arrayOf(intentFilter), null)
|
||||
|
|
|
@ -1467,19 +1467,17 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
|
|||
override fun doInBackground(vararg params: Any): BooleanArray {
|
||||
val activity = mActivityRef.get() ?: return BooleanArray(0)
|
||||
val result = BooleanArray(sources.size)
|
||||
var i = 0
|
||||
val j = sources.size
|
||||
while (i < j) {
|
||||
for (i in 0 until sources.size) {
|
||||
val source = sources[i]
|
||||
val destination = mDestinations[i]
|
||||
var `is`: InputStream? = null
|
||||
var st: InputStream? = null
|
||||
var os: OutputStream? = null
|
||||
try {
|
||||
val resolver = activity.contentResolver
|
||||
`is` = resolver.openInputStream(source)
|
||||
st = resolver.openInputStream(source)
|
||||
os = resolver.openOutputStream(destination)
|
||||
if (`is` == null || os == null) throw FileNotFoundException()
|
||||
StreamUtils.copy(`is`, os, null, null)
|
||||
if (st == null || os == null) throw FileNotFoundException()
|
||||
StreamUtils.copy(st, os, null, null)
|
||||
if (ContentResolver.SCHEME_FILE == source.scheme && mDeleteSrc) {
|
||||
val file = File(source.path)
|
||||
if (!file.delete()) {
|
||||
|
@ -1494,9 +1492,8 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
|
|||
result[i] = false
|
||||
} finally {
|
||||
Utils.closeSilently(os)
|
||||
Utils.closeSilently(`is`)
|
||||
Utils.closeSilently(st)
|
||||
}
|
||||
i++
|
||||
|
||||
}
|
||||
return result
|
||||
|
|
|
@ -679,9 +679,7 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
|||
var initialTab = -1
|
||||
if (tabType != null) {
|
||||
val accountKey = UserKey.valueOf(uri!!.getQueryParameter(QUERY_PARAM_ACCOUNT_KEY))
|
||||
var i = 0
|
||||
val j = pagerAdapter!!.count
|
||||
while (i < j) {
|
||||
for (i in 0 until pagerAdapter!!.count) {
|
||||
val tab = pagerAdapter!!.getTab(i)
|
||||
if (tabType == CustomTabUtils.getTabTypeAlias(tab.type)) {
|
||||
val args = tab.args
|
||||
|
@ -691,7 +689,6 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
|||
break
|
||||
}
|
||||
}
|
||||
i++
|
||||
}
|
||||
if (initialTab == -1 && (extraIntent == null || !handleExtraIntent)) {
|
||||
// Tab not found, open account specific page
|
||||
|
@ -715,11 +712,8 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
|||
}
|
||||
|
||||
private fun initUnreadCount() {
|
||||
var i = 0
|
||||
val j = mainTabs.count
|
||||
while (i < j) {
|
||||
for (i in 0 until mainTabs.count) {
|
||||
mainTabs.setBadge(i, 0)
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -894,11 +888,8 @@ class HomeActivity : BaseActivity(), OnClickListener, OnPageChangeListener, Supp
|
|||
|
||||
override fun onPostExecute(result: SparseIntArray) {
|
||||
indicator.clearBadge()
|
||||
var i = 0
|
||||
val j = result.size()
|
||||
while (i < j) {
|
||||
for (i in 0 until result.size()) {
|
||||
indicator.setBadge(result.keyAt(i), result.valueAt(i))
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -74,13 +74,10 @@ class QuickSearchBarActivity : BaseActivity(), OnClickListener, LoaderCallbacks<
|
|||
override fun onDismiss(listView: ListView, reverseSortedPositions: IntArray) {
|
||||
val adapter = suggestionsList.adapter as SuggestionsAdapter
|
||||
val ids = LongArray(reverseSortedPositions.size)
|
||||
var i = 0
|
||||
val j = reverseSortedPositions.size
|
||||
while (i < j) {
|
||||
for (i in 0 until reverseSortedPositions.size) {
|
||||
val position = reverseSortedPositions[i]
|
||||
val item = adapter.getSuggestionItem(position) ?: return
|
||||
ids[i] = item._id
|
||||
i++
|
||||
}
|
||||
adapter.addRemovedPositions(reverseSortedPositions)
|
||||
ContentResolverUtils.bulkDelete(contentResolver, SearchHistory.CONTENT_URI,
|
||||
|
@ -170,7 +167,7 @@ class QuickSearchBarActivity : BaseActivity(), OnClickListener, LoaderCallbacks<
|
|||
setContentView(R.layout.activity_quick_search_bar)
|
||||
val accounts = DataStoreUtils.getCredentialsList(this, false)
|
||||
val accountsSpinnerAdapter = AccountsSpinnerAdapter(this, R.layout.spinner_item_account_icon)
|
||||
accountsSpinnerAdapter.setDropDownViewResource(R.layout.list_item_user)
|
||||
accountsSpinnerAdapter.setDropDownViewResource(R.layout.list_item_simple_user)
|
||||
accountsSpinnerAdapter.addAll(accounts)
|
||||
accountSpinner.adapter = accountsSpinnerAdapter
|
||||
accountSpinner.onItemSelectedListener = this
|
||||
|
@ -417,13 +414,10 @@ class QuickSearchBarActivity : BaseActivity(), OnClickListener, LoaderCallbacks<
|
|||
private fun getActualPosition(position: Int): Int {
|
||||
if (removedPositions == null) return position
|
||||
var skipped = 0
|
||||
var i = 0
|
||||
val j = removedPositions.size()
|
||||
while (i < j) {
|
||||
for (i in 0 until removedPositions.size()) {
|
||||
if (position + skipped >= removedPositions.get(i)) {
|
||||
skipped++
|
||||
}
|
||||
i++
|
||||
}
|
||||
return position + skipped
|
||||
}
|
||||
|
|
|
@ -89,9 +89,7 @@ class SettingsActivity : BaseActivity(), OnItemClickListener, OnPreferenceStartF
|
|||
val initialTag = intent.getStringExtra(EXTRA_INITIAL_TAG)
|
||||
var initialItem = -1
|
||||
var firstEntry = -1
|
||||
var i = 0
|
||||
val j = mEntriesAdapter!!.count
|
||||
while (i < j) {
|
||||
for (i in 0 until mEntriesAdapter!!.count) {
|
||||
val entry = mEntriesAdapter!!.getItem(i)
|
||||
if (entry is PreferenceEntry) {
|
||||
if (firstEntry == -1) {
|
||||
|
@ -102,7 +100,6 @@ class SettingsActivity : BaseActivity(), OnItemClickListener, OnPreferenceStartF
|
|||
break
|
||||
}
|
||||
}
|
||||
i++
|
||||
}
|
||||
if (initialItem == -1) {
|
||||
initialItem = firstEntry
|
||||
|
|
|
@ -220,11 +220,8 @@ class SettingsWizardActivity : BaseActivity() {
|
|||
true
|
||||
}
|
||||
|
||||
var i = 0
|
||||
val j = screen.preferenceCount
|
||||
while (i < j) {
|
||||
for (i in 0 until screen.preferenceCount) {
|
||||
screen.getPreference(i).onPreferenceChangeListener = listener
|
||||
i++
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.mariotaku.twidere.util.dagger.GeneralComponentHelper
|
|||
|
||||
import javax.inject.Inject
|
||||
|
||||
class AccountsSpinnerAdapter @JvmOverloads constructor(context: Context, itemViewResource: Int = R.layout.list_item_user) : ArrayAdapter<ParcelableCredentials>(context, itemViewResource) {
|
||||
class AccountsSpinnerAdapter @JvmOverloads constructor(context: Context, itemViewResource: Int = R.layout.list_item_simple_user) : ArrayAdapter<ParcelableCredentials>(context, itemViewResource) {
|
||||
|
||||
@Inject
|
||||
lateinit var mediaLoader: MediaLoaderWrapper
|
||||
|
@ -115,13 +115,10 @@ class AccountsSpinnerAdapter @JvmOverloads constructor(context: Context, itemVie
|
|||
}
|
||||
|
||||
fun findPositionByKey(key: UserKey): Int {
|
||||
var i = 0
|
||||
val j = count
|
||||
while (i < j) {
|
||||
for (i in 0 until count) {
|
||||
if (key == getItem(i).account_key) {
|
||||
return i
|
||||
}
|
||||
i++
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
|
|
@ -52,13 +52,4 @@ abstract class BaseRecyclerViewAdapter<VH : RecyclerView.ViewHolder>(
|
|||
GeneralComponentHelper.build(context).inject(this as BaseRecyclerViewAdapter<RecyclerView.ViewHolder>)
|
||||
}
|
||||
|
||||
fun findPositionByItemId(itemId: Long): Int {
|
||||
var i = 0
|
||||
val j = itemCount
|
||||
while (i < j) {
|
||||
if (getItemId(i) == itemId) return i
|
||||
i++
|
||||
}
|
||||
return RecyclerView.NO_POSITION
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ class ListParcelableStatusesAdapter(context: Context) : ParcelableStatusesAdapte
|
|||
|
||||
fun createStatusViewHolder(adapter: IStatusesAdapter<*>,
|
||||
inflater: LayoutInflater, parent: ViewGroup): StatusViewHolder {
|
||||
val view = inflater.inflate(R.layout.card_item_status_compact, parent, false)
|
||||
val view = inflater.inflate(R.layout.list_item_status, parent, false)
|
||||
val holder = StatusViewHolder(adapter, view)
|
||||
holder.setOnClickListeners()
|
||||
holder.setupViewOptions()
|
||||
|
|
|
@ -24,6 +24,7 @@ import android.support.v4.widget.Space
|
|||
import android.support.v7.widget.RecyclerView
|
||||
import android.view.LayoutInflater
|
||||
import android.view.ViewGroup
|
||||
import org.mariotaku.ktextension.findPositionByItemId
|
||||
import org.mariotaku.ktextension.safeMoveToPosition
|
||||
import org.mariotaku.library.objectcursor.ObjectCursor
|
||||
import org.mariotaku.twidere.R
|
||||
|
@ -147,9 +148,15 @@ abstract class ParcelableStatusesAdapter(
|
|||
}
|
||||
|
||||
override fun getStatus(position: Int): ParcelableStatus? {
|
||||
val dataPosition = position - statusStartIndex
|
||||
if (dataPosition < 0 || dataPosition >= rawStatusCount) return null
|
||||
return data!![dataPosition]
|
||||
when (getItemCountIndex(position)) {
|
||||
1 -> {
|
||||
return pinnedStatuses!![position - getItemStartPosition(1)]
|
||||
}
|
||||
2 -> {
|
||||
return data!![position - getItemStartPosition(2)]
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
override val statusCount: Int
|
||||
|
@ -346,13 +353,10 @@ abstract class ParcelableStatusesAdapter(
|
|||
|
||||
|
||||
override fun findStatusById(accountKey: UserKey, statusId: String): ParcelableStatus? {
|
||||
var i = 0
|
||||
val j = statusCount
|
||||
while (i < j) {
|
||||
for (i in 0 until statusCount) {
|
||||
if (accountKey == getAccountKey(i) && statusId == getStatusId(i)) {
|
||||
return getStatus(i)
|
||||
}
|
||||
i++
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
|
|
@ -141,7 +141,7 @@ class ParcelableUserListsAdapter(context: Context) : LoadMoreSupportAdapter<Recy
|
|||
inflater: LayoutInflater,
|
||||
parent: ViewGroup): UserListViewHolder {
|
||||
val view: View
|
||||
view = inflater.inflate(R.layout.card_item_user_list_compact, parent, false)
|
||||
view = inflater.inflate(R.layout.list_item_user_list, parent, false)
|
||||
val holder = UserListViewHolder(adapter, view)
|
||||
holder.setOnClickListeners()
|
||||
holder.setupViewOptions()
|
||||
|
|
|
@ -132,14 +132,11 @@ class ParcelableUsersAdapter(context: Context) : LoadMoreSupportAdapter<Recycler
|
|||
|
||||
fun findPosition(accountKey: UserKey, userKey: UserKey): Int {
|
||||
if (data == null) return RecyclerView.NO_POSITION
|
||||
var i = userStartIndex
|
||||
val j = i + userCount
|
||||
while (i < j) {
|
||||
for (i in userStartIndex until userStartIndex + userCount) {
|
||||
val user = data!![i]
|
||||
if (accountKey == user.account_key && userKey == user.key) {
|
||||
return i
|
||||
}
|
||||
i++
|
||||
}
|
||||
return RecyclerView.NO_POSITION
|
||||
}
|
||||
|
@ -181,7 +178,7 @@ class ParcelableUsersAdapter(context: Context) : LoadMoreSupportAdapter<Recycler
|
|||
|
||||
|
||||
fun createUserViewHolder(adapter: IUsersAdapter<*>, inflater: LayoutInflater, parent: ViewGroup): UserViewHolder {
|
||||
val view = inflater.inflate(R.layout.card_item_user_compact, parent, false)
|
||||
val view = inflater.inflate(R.layout.list_item_user, parent, false)
|
||||
val holder = UserViewHolder(adapter, view)
|
||||
holder.setOnClickListeners()
|
||||
holder.setupViewOptions()
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.mariotaku.twidere.view.holder.TwoLineWithIconViewHolder
|
|||
|
||||
class SimpleParcelableUsersAdapter @JvmOverloads constructor(
|
||||
context: Context,
|
||||
layoutRes: Int = R.layout.list_item_user
|
||||
layoutRes: Int = R.layout.list_item_simple_user
|
||||
) : BaseArrayAdapter<ParcelableUser>(context, layoutRes), IBaseAdapter {
|
||||
|
||||
init {
|
||||
|
@ -87,11 +87,8 @@ class SimpleParcelableUsersAdapter @JvmOverloads constructor(
|
|||
}
|
||||
|
||||
fun findUserPosition(userKey: UserKey): Int {
|
||||
var i = 0
|
||||
val j = count
|
||||
while (i < j) {
|
||||
for (i in 0 until count) {
|
||||
if (userKey == getItem(i).key) return i
|
||||
i++
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
|
|
@ -659,16 +659,6 @@ class AccountsDashboardFragment : BaseSupportFragment(), LoaderCallbacks<Account
|
|||
setHasStableIds(true)
|
||||
}
|
||||
|
||||
private fun indexOfAccount(accounts: List<ParcelableAccount>, accountId: UserKey): Int {
|
||||
var i = 0
|
||||
val j = accounts.size
|
||||
while (i < j) {
|
||||
if (accounts[i].account_key == accountId) return i
|
||||
i++
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
fun getAdapterAccount(adapterPosition: Int): ParcelableAccount? {
|
||||
if (accounts == null || accounts!!.size < 1) {
|
||||
return null
|
||||
|
|
|
@ -152,15 +152,12 @@ class AccountsManagerFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>,
|
|||
private fun saveActivatedState() {
|
||||
val trueIds = CompactHashSet<UserKey>()
|
||||
val falseIds = CompactHashSet<UserKey>()
|
||||
var i = 0
|
||||
val j = activatedState.size()
|
||||
while (i < j) {
|
||||
for (i in 0 until activatedState.size()) {
|
||||
if (activatedState.valueAt(i)) {
|
||||
trueIds.add(activatedState.keyAt(i))
|
||||
} else {
|
||||
falseIds.add(activatedState.keyAt(i))
|
||||
}
|
||||
i++
|
||||
}
|
||||
val cr = contentResolver
|
||||
val values = ContentValues()
|
||||
|
@ -228,16 +225,13 @@ class AccountsManagerFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>,
|
|||
val c = adapter!!.cursor
|
||||
if (positions != null && c != null && !c.isClosed) {
|
||||
val idIdx = c.getColumnIndex(Accounts._ID)
|
||||
var i = 0
|
||||
val j = positions.size
|
||||
while (i < j) {
|
||||
for (i in 0 until positions.size) {
|
||||
c.moveToPosition(positions[i])
|
||||
val id = c.getLong(idIdx)
|
||||
val values = ContentValues()
|
||||
values.put(Accounts.SORT_POSITION, i)
|
||||
val where = Expression.equals(Accounts._ID, id)
|
||||
cr.update(Accounts.CONTENT_URI, values, where.sql, null)
|
||||
i++
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,26 +49,21 @@ class AddStatusFilterDialogFragment : BaseDialogFragment() {
|
|||
filterItems = filterItemsInfo
|
||||
val entries = arrayOfNulls<String>(filterItems!!.size)
|
||||
val nameFirst = preferences.getBoolean(KEY_NAME_FIRST)
|
||||
run {
|
||||
var i = 0
|
||||
val j = entries.size
|
||||
while (i < j) {
|
||||
val info = filterItems!![i]
|
||||
when (info.type) {
|
||||
FilterItemInfo.FILTER_TYPE_USER -> {
|
||||
entries[i] = getString(R.string.user_filter_name, getName(userColorNameManager,
|
||||
info.value, nameFirst))
|
||||
}
|
||||
FilterItemInfo.FILTER_TYPE_KEYWORD -> {
|
||||
entries[i] = getString(R.string.keyword_filter_name, getName(userColorNameManager,
|
||||
info.value, nameFirst))
|
||||
}
|
||||
FilterItemInfo.FILTER_TYPE_SOURCE -> {
|
||||
entries[i] = getString(R.string.source_filter_name, getName(userColorNameManager,
|
||||
info.value, nameFirst))
|
||||
}
|
||||
for (i in 0 until entries.size) {
|
||||
val info = filterItems!![i]
|
||||
when (info.type) {
|
||||
FilterItemInfo.FILTER_TYPE_USER -> {
|
||||
entries[i] = getString(R.string.user_filter_name, getName(userColorNameManager,
|
||||
info.value, nameFirst))
|
||||
}
|
||||
FilterItemInfo.FILTER_TYPE_KEYWORD -> {
|
||||
entries[i] = getString(R.string.keyword_filter_name, getName(userColorNameManager,
|
||||
info.value, nameFirst))
|
||||
}
|
||||
FilterItemInfo.FILTER_TYPE_SOURCE -> {
|
||||
entries[i] = getString(R.string.source_filter_name, getName(userColorNameManager,
|
||||
info.value, nameFirst))
|
||||
}
|
||||
i++
|
||||
}
|
||||
}
|
||||
builder.setTitle(R.string.add_to_filter)
|
||||
|
@ -83,12 +78,9 @@ class AddStatusFilterDialogFragment : BaseDialogFragment() {
|
|||
val userValues = ArrayList<ContentValues>()
|
||||
val keywordValues = ArrayList<ContentValues>()
|
||||
val sourceValues = ArrayList<ContentValues>()
|
||||
var i = 0
|
||||
val j = checkPositions.size()
|
||||
while (i < j) {
|
||||
loop@ for (i in 0 until checkPositions.size()) {
|
||||
if (!checkPositions.valueAt(i)) {
|
||||
i++
|
||||
continue
|
||||
continue@loop
|
||||
}
|
||||
val info = filterItems!![checkPositions.keyAt(i)]
|
||||
val value = info.value
|
||||
|
@ -111,7 +103,6 @@ class AddStatusFilterDialogFragment : BaseDialogFragment() {
|
|||
values.put(Filters.Sources.VALUE, source)
|
||||
sourceValues.add(values)
|
||||
}
|
||||
i++
|
||||
}
|
||||
val resolver = contentResolver
|
||||
ContentResolverUtils.bulkDelete(resolver, Filters.Users.CONTENT_URI, Filters.Users.USER_KEY, userKeys, null)
|
||||
|
|
|
@ -122,12 +122,9 @@ abstract class BaseFiltersFragment : AbsContentListViewFragment<SimpleCursorAdap
|
|||
contentResolver.delete(contentUri, where.sql, null)
|
||||
}
|
||||
R.id.inverse_selection -> {
|
||||
val positions = listView.getCheckedItemPositions()
|
||||
var i = 0
|
||||
val j = listView.getCount()
|
||||
while (i < j) {
|
||||
val positions = listView.checkedItemPositions
|
||||
for (i in 0 until listView.count) {
|
||||
listView.setItemChecked(i, !positions.get(i))
|
||||
i++
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
|
|
@ -271,14 +271,11 @@ abstract class CursorActivitiesFragment : AbsActivitiesFragment() {
|
|||
val adapter = adapter
|
||||
val rangeStart = Math.max(adapter!!.activityStartIndex, lm!!.findFirstVisibleItemPosition())
|
||||
val rangeEnd = Math.min(lm.findLastVisibleItemPosition(), adapter.activityStartIndex + adapter.activityCount - 1)
|
||||
var i = rangeStart
|
||||
val j = rangeEnd + 1
|
||||
while (i < j) {
|
||||
loop@ for (i in rangeStart..rangeEnd) {
|
||||
val activity = adapter.getActivity(i)
|
||||
if (result.account_key == activity!!.account_key && result.id == activity.status_id) {
|
||||
if (result.id != activity.status_id) {
|
||||
i++
|
||||
continue
|
||||
continue@loop
|
||||
}
|
||||
val statusesMatrix = arrayOf(activity.target_statuses, activity.target_object_statuses)
|
||||
for (statusesArray in statusesMatrix) {
|
||||
|
@ -294,7 +291,6 @@ abstract class CursorActivitiesFragment : AbsActivitiesFragment() {
|
|||
}
|
||||
}
|
||||
}
|
||||
i++
|
||||
}
|
||||
adapter.notifyItemRangeChanged(rangeStart, rangeEnd)
|
||||
}
|
||||
|
|
|
@ -239,16 +239,13 @@ class CustomTabsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, Mult
|
|||
val c = adapter!!.cursor
|
||||
if (positions != null && c != null && !c.isClosed) {
|
||||
val idIdx = c.getColumnIndex(Tabs._ID)
|
||||
var i = 0
|
||||
val j = positions.size
|
||||
while (i < j) {
|
||||
for (i in 0 until positions.size) {
|
||||
c.moveToPosition(positions[i])
|
||||
val id = c.getLong(idIdx)
|
||||
val values = ContentValues()
|
||||
values.put(Tabs.POSITION, i)
|
||||
val where = Expression.equals(Tabs._ID, id).sql
|
||||
contentResolver.update(Tabs.CONTENT_URI, values, where, null)
|
||||
i++
|
||||
}
|
||||
}
|
||||
SettingsActivity.setShouldRestart(activity)
|
||||
|
|
|
@ -94,13 +94,10 @@ class DraftsFragment : BaseSupportFragment(), LoaderCallbacks<Cursor?>, OnItemCl
|
|||
val checked = listView!!.checkedItemPositions
|
||||
val list = ArrayList<Draft>()
|
||||
val indices = DraftCursorIndices(c)
|
||||
var i = 0
|
||||
val j = checked.size()
|
||||
while (i < j) {
|
||||
for (i in 0 until checked.size()) {
|
||||
if (checked.valueAt(i) && c.moveToPosition(checked.keyAt(i))) {
|
||||
list.add(indices.newObject(c))
|
||||
}
|
||||
i++
|
||||
}
|
||||
if (sendDrafts(list)) {
|
||||
val where = Expression.`in`(Column(Drafts._ID),
|
||||
|
|
|
@ -172,7 +172,7 @@ class MessagesConversationFragment : BaseSupportFragment(), LoaderCallbacks<Curs
|
|||
val accounts = DataStoreUtils.getCredentialsList(activity, false)
|
||||
val accountsSpinnerAdapter = AccountsSpinnerAdapter(
|
||||
actionBar.themedContext, R.layout.spinner_item_account_icon)
|
||||
accountsSpinnerAdapter.setDropDownViewResource(R.layout.list_item_user)
|
||||
accountsSpinnerAdapter.setDropDownViewResource(R.layout.list_item_simple_user)
|
||||
accountsSpinnerAdapter.addAll(accounts)
|
||||
actionBarCustomView.accountSpinner.adapter = accountsSpinnerAdapter
|
||||
actionBarCustomView.accountSpinner.onItemSelectedListener = this
|
||||
|
|
|
@ -166,9 +166,7 @@ abstract class ParcelableStatusesFragment : AbsStatusesFragment() {
|
|||
val adapter = adapter
|
||||
val rangeStart = Math.max(adapter!!.statusStartIndex, lm!!.findFirstVisibleItemPosition())
|
||||
val rangeEnd = Math.min(lm.findLastVisibleItemPosition(), adapter.statusStartIndex + adapter.statusCount - 1)
|
||||
var i = rangeStart
|
||||
val j = rangeEnd + 1
|
||||
while (i < j) {
|
||||
for (i in rangeStart..rangeEnd) {
|
||||
val item = adapter.getStatus(i)
|
||||
if (status == item) {
|
||||
item.favorite_count = status.favorite_count
|
||||
|
@ -177,7 +175,6 @@ abstract class ParcelableStatusesFragment : AbsStatusesFragment() {
|
|||
|
||||
item.is_favorite = status.is_favorite
|
||||
}
|
||||
i++
|
||||
}
|
||||
adapter.notifyItemRangeChanged(rangeStart, rangeEnd)
|
||||
}
|
||||
|
@ -224,15 +221,11 @@ abstract class ParcelableStatusesFragment : AbsStatusesFragment() {
|
|||
private fun updateRetweetedStatuses(status: ParcelableStatus?) {
|
||||
val data = adapterData
|
||||
if (status == null || status.retweet_id == null || data == null) return
|
||||
var i = 0
|
||||
val j = data.size
|
||||
while (i < j) {
|
||||
val orig = data[i]
|
||||
data.forEach { orig ->
|
||||
if (orig.account_key == status.account_key && TextUtils.equals(orig.id, status.retweet_id)) {
|
||||
orig.my_retweet_id = status.my_retweet_id
|
||||
orig.retweet_count = status.retweet_count
|
||||
}
|
||||
i++
|
||||
}
|
||||
adapterData = data
|
||||
}
|
||||
|
|
|
@ -69,6 +69,7 @@ import kotlinx.android.synthetic.main.adapter_item_status_count_label.view.*
|
|||
import kotlinx.android.synthetic.main.fragment_status.*
|
||||
import kotlinx.android.synthetic.main.header_status_common.view.*
|
||||
import kotlinx.android.synthetic.main.layout_content_fragment_common.*
|
||||
import org.mariotaku.ktextension.findPositionByItemId
|
||||
import org.mariotaku.microblog.library.MicroBlogException
|
||||
import org.mariotaku.microblog.library.twitter.model.Paging
|
||||
import org.mariotaku.microblog.library.twitter.model.TranslationResult
|
||||
|
@ -574,7 +575,7 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
|
||||
private fun restoreReadPosition(position: ReadPosition?) {
|
||||
if (position == null) return
|
||||
val adapterPosition = adapter!!.findPositionById(position.statusId)
|
||||
val adapterPosition = adapter!!.findPositionByItemId(position.statusId)
|
||||
if (adapterPosition < 0) return
|
||||
//TODO maintain read position
|
||||
layoutManager!!.scrollToPositionWithOffset(adapterPosition, position.offsetTop)
|
||||
|
@ -1485,16 +1486,6 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
twidereLinkify = TwidereLinkify(listener)
|
||||
}
|
||||
|
||||
fun findPositionById(itemId: Long): Int {
|
||||
var i = 0
|
||||
val j = itemCount
|
||||
while (i < j) {
|
||||
if (getItemId(i) == itemId) return i
|
||||
i++
|
||||
}
|
||||
return RecyclerView.NO_POSITION
|
||||
}
|
||||
|
||||
override val textSize: Float
|
||||
get() = mTextSize.toFloat()
|
||||
|
||||
|
@ -1597,19 +1588,16 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
var conversationCount = 0
|
||||
var replyCount = 0
|
||||
var replyStart = -1
|
||||
var i = 0
|
||||
val j = data.size
|
||||
while (i < j) {
|
||||
for (i in 0 until data.size) {
|
||||
val item = data[i]
|
||||
if (item.sort_id < sortId) {
|
||||
conversationCount++
|
||||
} else if (item.sort_id > sortId) {
|
||||
} else if (item.sort_id > sortId && status.id != item.id) {
|
||||
if (replyStart < 0) {
|
||||
replyStart = i
|
||||
}
|
||||
replyCount++
|
||||
}
|
||||
i++
|
||||
}
|
||||
setTypeCount(ITEM_IDX_CONVERSATION, conversationCount)
|
||||
setTypeCount(ITEM_IDX_REPLY, replyCount)
|
||||
|
@ -1912,9 +1900,7 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
override fun getDecoratedMeasuredHeight(child: View): Int {
|
||||
var heightBeforeSpace = 0
|
||||
if (getItemViewType(child) == StatusAdapter.VIEW_TYPE_SPACE) {
|
||||
var i = 0
|
||||
val j = childCount
|
||||
while (i < j) {
|
||||
for (i in 0 until childCount) {
|
||||
val childToMeasure = getChildAt(i)
|
||||
val paramsToMeasure = childToMeasure.layoutParams as LayoutParams
|
||||
val typeToMeasure = getItemViewType(childToMeasure)
|
||||
|
@ -1925,7 +1911,6 @@ class StatusFragment : BaseSupportFragment(), LoaderCallbacks<SingleResponse<Par
|
|||
heightBeforeSpace += super.getDecoratedMeasuredHeight(childToMeasure)
|
||||
+paramsToMeasure.topMargin + paramsToMeasure.bottomMargin
|
||||
}
|
||||
i++
|
||||
}
|
||||
if (heightBeforeSpace != 0) {
|
||||
val spaceHeight = recyclerView.measuredHeight - heightBeforeSpace
|
||||
|
|
|
@ -139,12 +139,7 @@ class UserListMembersFragment : CursorSupportUsersListFragment() {
|
|||
users.removeAll(newUsers)
|
||||
users.addAll(0, newUsers)
|
||||
}
|
||||
var i = 0
|
||||
val j = users.size
|
||||
while (i < j) {
|
||||
users[i].position = i.toLong()
|
||||
i++
|
||||
}
|
||||
users.forEachIndexed { idx, user -> user.position = idx.toLong() }
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
UserListMembersChangedEvent.Action.REMOVED -> {
|
||||
|
@ -154,12 +149,7 @@ class UserListMembersFragment : CursorSupportUsersListFragment() {
|
|||
if (users is MutableList) {
|
||||
users.removeAll(removedUsers)
|
||||
}
|
||||
var i = 0
|
||||
val j = users.size
|
||||
while (i < j) {
|
||||
users[i].position = i.toLong()
|
||||
i++
|
||||
}
|
||||
users.forEachIndexed { idx, user -> user.position = idx.toLong() }
|
||||
adapter.notifyDataSetChanged()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -127,19 +127,14 @@ abstract class MicroBlogAPIStatusesLoader(
|
|||
val statusIds = arrayOfNulls<String>(statuses.size)
|
||||
var minIdx = -1
|
||||
var rowsDeleted = 0
|
||||
run {
|
||||
var i = 0
|
||||
val j = statuses.size
|
||||
while (i < j) {
|
||||
val status = statuses[i]
|
||||
if (minIdx == -1 || status < statuses[minIdx]) {
|
||||
minIdx = i
|
||||
}
|
||||
statusIds[i] = status.id
|
||||
if (deleteStatus(data, status.id)) {
|
||||
rowsDeleted++
|
||||
}
|
||||
i++
|
||||
for (i in 0 until statuses.size) {
|
||||
val status = statuses[i]
|
||||
if (minIdx == -1 || status < statuses[minIdx]) {
|
||||
minIdx = i
|
||||
}
|
||||
statusIds[i] = status.id
|
||||
if (deleteStatus(data, status.id)) {
|
||||
rowsDeleted++
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -430,13 +430,10 @@ class OAuthPasswordAuthenticator(
|
|||
for (pathSegments in originalLocation.pathSegments()) {
|
||||
locationBuilder.addPathSegment(pathSegments)
|
||||
}
|
||||
var i = 0
|
||||
val j = originalLocation.querySize()
|
||||
while (i < j) {
|
||||
for (i in 0 until originalLocation.querySize()) {
|
||||
val name = originalLocation.queryParameterName(i)
|
||||
val value = originalLocation.queryParameterValue(i)
|
||||
locationBuilder.addQueryParameter(name, value)
|
||||
i++
|
||||
}
|
||||
val encodedFragment = originalLocation.encodedFragment()
|
||||
if (encodedFragment != null) {
|
||||
|
|
|
@ -130,9 +130,7 @@ class ActivityTitleSummaryViewHolder(private val adapter: ParcelableActivitiesAd
|
|||
return
|
||||
}
|
||||
val length = Math.min(profileImageViews.size, statuses.size)
|
||||
var i = 0
|
||||
val j = profileImageViews.size
|
||||
while (i < j) {
|
||||
for (i in 0 until profileImageViews.size) {
|
||||
val view = profileImageViews[i]
|
||||
view.setImageDrawable(null)
|
||||
if (i < length) {
|
||||
|
@ -142,7 +140,6 @@ class ActivityTitleSummaryViewHolder(private val adapter: ParcelableActivitiesAd
|
|||
imageLoader.cancelDisplayTask(view)
|
||||
view.visibility = View.GONE
|
||||
}
|
||||
i++
|
||||
}
|
||||
if (statuses.size > profileImageViews.size) {
|
||||
val moreNumber = statuses.size - profileImageViews.size
|
||||
|
|
|
@ -27,7 +27,7 @@ import android.view.View.OnLongClickListener
|
|||
import android.widget.ImageButton
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import kotlinx.android.synthetic.main.card_item_user_compact.view.*
|
||||
import kotlinx.android.synthetic.main.list_item_user.view.*
|
||||
import org.mariotaku.twidere.R
|
||||
import org.mariotaku.twidere.adapter.iface.IUsersAdapter
|
||||
import org.mariotaku.twidere.adapter.iface.IUsersAdapter.*
|
||||
|
|
|
@ -1,270 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2014 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ 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/>.
|
||||
-->
|
||||
|
||||
<org.mariotaku.twidere.view.ColorLabelRelativeLayout
|
||||
android:id="@+id/itemContent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
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:background="?selectableItemBackground"
|
||||
android:clipChildren="false"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
app:ignorePadding="true"
|
||||
tools:context=".adapter.ParcelableUsersAdapter">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/profileImageContainer"
|
||||
android:layout_width="@dimen/icon_size_card_list_item"
|
||||
android:layout_height="@dimen/icon_size_card_list_item"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignTop="@+id/actionsProgressContainer"
|
||||
android:layout_marginEnd="@dimen/element_spacing_normal"
|
||||
android:layout_marginRight="@dimen/element_spacing_normal"
|
||||
android:clipChildren="false"
|
||||
tools:visibility="visible">
|
||||
|
||||
<org.mariotaku.twidere.view.ProfileImageView
|
||||
android:id="@+id/profileImage"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_card_list_item"
|
||||
android:layout_height="@dimen/icon_size_card_list_item"
|
||||
android:layout_centerInParent="true"
|
||||
android:contentDescription="@string/profile_image"
|
||||
tools:src="@mipmap/ic_launcher"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profileType"
|
||||
android:layout_width="@dimen/icon_size_profile_type"
|
||||
android:layout_height="@dimen/icon_size_profile_type"
|
||||
android:layout_alignBottom="@+id/profileImage"
|
||||
android:layout_alignEnd="@+id/profileImage"
|
||||
android:layout_alignRight="@+id/profileImage"
|
||||
android:layout_marginBottom="@dimen/element_spacing_minus_small"
|
||||
android:layout_marginEnd="@dimen/element_spacing_minus_normal"
|
||||
android:layout_marginRight="@dimen/element_spacing_minus_normal"
|
||||
android:scaleType="centerInside"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_user_type_verified"
|
||||
tools:visibility="visible"/>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<org.mariotaku.twidere.view.NameView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/actionsProgressContainer"
|
||||
android:layout_alignTop="@+id/actionsProgressContainer"
|
||||
android:layout_toEndOf="@+id/profileImageContainer"
|
||||
android:layout_toLeftOf="@+id/actionsProgressContainer"
|
||||
android:layout_toRightOf="@+id/profileImageContainer"
|
||||
android:layout_toStartOf="@+id/actionsProgressContainer"
|
||||
android:gravity="center_vertical"
|
||||
app:nv_primaryTextColor="?android:textColorPrimary"
|
||||
app:nv_primaryTextStyle="bold"
|
||||
app:nv_secondaryTextColor="?android:textColorSecondary"
|
||||
app:nv_twoLine="true"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/actionsProgressContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:clipChildren="false"
|
||||
android:minHeight="@dimen/button_size_content_card"
|
||||
android:minWidth="@dimen/button_size_content_card">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/actionsContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:orientation="horizontal"
|
||||
tools:visibility="visible">
|
||||
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/unmute"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/follow"
|
||||
android:src="@drawable/ic_action_visibility_off"
|
||||
app:backgroundTint="@color/material_grey"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/follow"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/follow"
|
||||
android:src="@drawable/ic_action_add"
|
||||
app:backgroundTint="@color/color_stateful_follow"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/acceptRequest"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/accept"
|
||||
android:src="@drawable/ic_action_confirm"
|
||||
app:backgroundTint="@color/material_light_green"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/denyRequest"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/deny"
|
||||
android:src="@drawable/ic_action_cancel"
|
||||
app:backgroundTint="@color/material_red"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/unblock"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/deny"
|
||||
android:src="@drawable/ic_action_block"
|
||||
app:backgroundTint="@color/material_red"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/processingRequest"
|
||||
style="?android:progressBarStyleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/externalIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/name"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textStyle="italic"
|
||||
tools:text="External user at twitter.com"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/externalIndicator"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="@string/sample_status_text"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/location"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/description"
|
||||
android:drawableLeft="@drawable/ic_indicator_location"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_location"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="Earth"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/location"
|
||||
android:drawableLeft="@drawable/ic_indicator_web"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_web"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="https://github.com/TwidereProject"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/url"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/element_spacing_small">
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/statusesCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_twitter"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_twitter"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="255"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/followersCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_followers"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_followers"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="255"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/friendsCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_following"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_following"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="255"/>
|
||||
</LinearLayout>
|
||||
|
||||
</org.mariotaku.twidere.view.ColorLabelRelativeLayout>
|
|
@ -1,124 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2014 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ 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/>.
|
||||
-->
|
||||
|
||||
<org.mariotaku.twidere.view.ColorLabelRelativeLayout
|
||||
android:id="@+id/itemContent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
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:background="?selectableItemBackground"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
app:ignorePadding="true"
|
||||
tools:context=".adapter.ParcelableUsersAdapter">
|
||||
|
||||
<org.mariotaku.twidere.view.ProfileImageView
|
||||
android:id="@+id/profileImage"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_card_list_item"
|
||||
android:layout_height="@dimen/icon_size_card_list_item"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginEnd="@dimen/element_spacing_normal"
|
||||
android:layout_marginRight="@dimen/element_spacing_normal"
|
||||
android:contentDescription="@string/profile_image"
|
||||
android:scaleType="fitCenter"
|
||||
tools:src="@mipmap/ic_launcher"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/nameContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_toEndOf="@+id/profileImage"
|
||||
android:layout_toRightOf="@+id/profileImage"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.mariotaku.twidere.view.TimelineContentTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
tools:text="List"/>
|
||||
|
||||
<org.mariotaku.twidere.view.TimelineContentTextView
|
||||
android:id="@+id/createdBy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="Created by user"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/nameContainer"
|
||||
android:layout_alignStart="@+id/nameContainer"
|
||||
android:layout_below="@+id/nameContainer"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/description"
|
||||
android:layout_alignStart="@+id/description"
|
||||
android:layout_below="@id/description"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/element_spacing_small">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/membersCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_following"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableStart="@drawable/ic_indicator_following"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subscribersCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_followers"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableStart="@drawable/ic_indicator_followers"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
</LinearLayout>
|
||||
|
||||
</org.mariotaku.twidere.view.ColorLabelRelativeLayout>
|
|
@ -28,6 +28,6 @@
|
|||
android:paddingLeft="@dimen/element_spacing_large"
|
||||
android:paddingRight="@dimen/element_spacing_large">
|
||||
|
||||
<include layout="@layout/card_item_status_compact"/>
|
||||
<include layout="@layout/list_item_status"/>
|
||||
|
||||
</ScrollView>
|
|
@ -80,7 +80,7 @@
|
|||
android:src="@drawable/ic_action_more_vertical"/>
|
||||
</RelativeLayout>
|
||||
|
||||
<include layout="@layout/card_item_status_compact"/>
|
||||
<include layout="@layout/list_item_status"/>
|
||||
</LinearLayout>
|
||||
|
||||
</ScrollView>
|
|
@ -24,6 +24,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<include layout="@layout/card_item_status_compact"/>
|
||||
<include layout="@layout/list_item_status"/>
|
||||
|
||||
</ScrollView>
|
|
@ -32,8 +32,8 @@
|
|||
android:id="@+id/accountProfileBanner"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignBottom="@id/profileContainer"
|
||||
android:layout_alignTop="@id/profileContainer"
|
||||
android:layout_alignBottom="@+id/profileContainer"
|
||||
android:layout_alignTop="@+id/profileContainer"
|
||||
android:contentDescription="@string/profile_banner"
|
||||
android:focusable="false"
|
||||
android:foreground="@color/drawer_banner_foreground"
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
tools:showIn="@layout/card_item_status_compact">
|
||||
tools:showIn="@layout/list_item_status">
|
||||
|
||||
<com.commonsware.cwac.layouts.AspectLockedFrameLayout
|
||||
android:id="@+id/media_preview_item_0"
|
||||
|
|
|
@ -4,6 +4,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<include layout="@layout/card_item_status_compact"/>
|
||||
<include layout="@layout/list_item_status"/>
|
||||
|
||||
</FrameLayout>
|
|
@ -4,6 +4,6 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<include layout="@layout/card_item_status_compact"/>
|
||||
<include layout="@layout/list_item_status"/>
|
||||
|
||||
</FrameLayout>
|
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2014 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ 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/>.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="?android:listPreferredItemHeightSmall"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/element_spacing_normal">
|
||||
|
||||
<org.mariotaku.twidere.view.ProfileImageView
|
||||
android:id="@android:id/icon"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_list_item_small"
|
||||
android:layout_height="@dimen/icon_size_list_item_small"
|
||||
android:contentDescription="@string/icon"
|
||||
android:scaleType="centerCrop"
|
||||
tools:src="@mipmap/ic_launcher"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="0dp"
|
||||
android:paddingLeft="@dimen/element_spacing_small"
|
||||
android:paddingRight="0dp"
|
||||
android:paddingStart="@dimen/element_spacing_small">
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
android:textColor="?android:textColorPrimary"
|
||||
tools:text="User name"/>
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="\@screenname"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2015 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ 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/>.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/element_spacing_normal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="@dimen/element_spacing_normal"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="@dimen/element_spacing_normal"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/element_spacing_xsmall"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
tools:text="Sample list"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/createdBy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/element_spacing_xsmall"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="Created by Mariotaku"/>
|
||||
</LinearLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.ProfileImageView
|
||||
android:id="@+id/profileImage"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_card_list_item"
|
||||
android:layout_height="@dimen/icon_size_card_list_item"
|
||||
android:layout_weight="0"
|
||||
android:contentDescription="@string/profile_image"
|
||||
android:scaleType="fitCenter"/>
|
||||
</LinearLayout>
|
|
@ -17,48 +17,254 @@
|
|||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<org.mariotaku.twidere.view.ColorLabelRelativeLayout
|
||||
android:id="@+id/itemContent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
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:gravity="center_vertical"
|
||||
android:minHeight="?android:listPreferredItemHeightSmall"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/element_spacing_normal">
|
||||
android:background="?selectableItemBackground"
|
||||
android:clipChildren="false"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
app:ignorePadding="true"
|
||||
tools:context=".adapter.ParcelableUsersAdapter">
|
||||
|
||||
<org.mariotaku.twidere.view.ProfileImageView
|
||||
android:id="@android:id/icon"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_list_item_small"
|
||||
android:layout_height="@dimen/icon_size_list_item_small"
|
||||
android:contentDescription="@string/icon"
|
||||
android:scaleType="centerCrop" />
|
||||
<RelativeLayout
|
||||
android:id="@+id/profileImageContainer"
|
||||
android:layout_width="@dimen/icon_size_card_list_item"
|
||||
android:layout_height="@dimen/icon_size_card_list_item"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignTop="@+id/actionsProgressContainer"
|
||||
android:layout_marginEnd="@dimen/element_spacing_normal"
|
||||
android:layout_marginRight="@dimen/element_spacing_normal"
|
||||
android:clipChildren="false"
|
||||
tools:visibility="visible">
|
||||
|
||||
<org.mariotaku.twidere.view.ProfileImageView
|
||||
android:id="@+id/profileImage"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_card_list_item"
|
||||
android:layout_height="@dimen/icon_size_card_list_item"
|
||||
android:layout_centerInParent="true"
|
||||
android:contentDescription="@string/profile_image"
|
||||
tools:src="@mipmap/ic_launcher"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/profileType"
|
||||
android:layout_width="@dimen/icon_size_profile_type"
|
||||
android:layout_height="@dimen/icon_size_profile_type"
|
||||
android:layout_alignBottom="@+id/profileImage"
|
||||
android:layout_alignEnd="@+id/profileImage"
|
||||
android:layout_alignRight="@+id/profileImage"
|
||||
android:layout_marginBottom="@dimen/element_spacing_minus_small"
|
||||
android:layout_marginEnd="@dimen/element_spacing_minus_normal"
|
||||
android:layout_marginRight="@dimen/element_spacing_minus_normal"
|
||||
android:scaleType="centerInside"
|
||||
tools:ignore="ContentDescription"
|
||||
tools:src="@drawable/ic_user_type_verified"
|
||||
tools:visibility="visible"/>
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<org.mariotaku.twidere.view.NameView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/actionsProgressContainer"
|
||||
android:layout_alignTop="@+id/actionsProgressContainer"
|
||||
android:layout_toEndOf="@+id/profileImageContainer"
|
||||
android:layout_toLeftOf="@+id/actionsProgressContainer"
|
||||
android:layout_toRightOf="@+id/profileImageContainer"
|
||||
android:layout_toStartOf="@+id/actionsProgressContainer"
|
||||
android:gravity="center_vertical"
|
||||
app:nv_primaryTextColor="?android:textColorPrimary"
|
||||
app:nv_primaryTextStyle="bold"
|
||||
app:nv_secondaryTextColor="?android:textColorSecondary"
|
||||
app:nv_twoLine="true"/>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/actionsProgressContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:clipChildren="false"
|
||||
android:minHeight="@dimen/button_size_content_card"
|
||||
android:minWidth="@dimen/button_size_content_card">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/actionsContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:clipChildren="false"
|
||||
android:orientation="horizontal"
|
||||
tools:visibility="visible">
|
||||
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/unmute"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/follow"
|
||||
android:src="@drawable/ic_action_visibility_off"
|
||||
app:backgroundTint="@color/material_grey"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/follow"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/follow"
|
||||
android:src="@drawable/ic_action_add"
|
||||
app:backgroundTint="@color/color_stateful_follow"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/acceptRequest"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/accept"
|
||||
android:src="@drawable/ic_action_confirm"
|
||||
app:backgroundTint="@color/material_light_green"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/denyRequest"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/deny"
|
||||
android:src="@drawable/ic_action_cancel"
|
||||
app:backgroundTint="@color/material_red"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
<org.mariotaku.twidere.view.IconActionButton
|
||||
android:id="@+id/unblock"
|
||||
style="?buttonStyleSmall"
|
||||
android:layout_width="@dimen/button_size_content_card"
|
||||
android:layout_height="@dimen/button_size_content_card"
|
||||
android:contentDescription="@string/deny"
|
||||
android:src="@drawable/ic_action_block"
|
||||
app:backgroundTint="@color/material_red"
|
||||
app:iabColor="@android:color/transparent"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/processingRequest"
|
||||
style="?android:progressBarStyleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"/>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/externalIndicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/name"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
android:textStyle="italic"
|
||||
tools:text="External user at twitter.com"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/externalIndicator"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="@string/sample_status_text"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/location"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/description"
|
||||
android:drawableLeft="@drawable/ic_indicator_location"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_location"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="Earth"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/url"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/location"
|
||||
android:drawableLeft="@drawable/ic_indicator_web"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_web"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="https://github.com/TwidereProject"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="0dp"
|
||||
android:paddingLeft="@dimen/element_spacing_small"
|
||||
android:paddingRight="0dp"
|
||||
android:paddingStart="@dimen/element_spacing_small">
|
||||
android:layout_alignLeft="@+id/name"
|
||||
android:layout_alignStart="@+id/name"
|
||||
android:layout_below="@+id/url"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/element_spacing_small">
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||
tools:text="Mariotaku" />
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text2"
|
||||
android:layout_width="wrap_content"
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/statusesCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_twitter"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_twitter"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="\@mariotaku" />
|
||||
tools:text="255"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/followersCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_followers"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_followers"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="255"/>
|
||||
|
||||
<org.mariotaku.twidere.view.ActionIconThemedTextView
|
||||
android:id="@+id/friendsCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_following"
|
||||
android:drawablePadding="@dimen/element_spacing_small"
|
||||
android:drawableStart="@drawable/ic_indicator_following"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
tools:text="255"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</org.mariotaku.twidere.view.ColorLabelRelativeLayout>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?><!--
|
||||
~ Twidere - Twitter client for Android
|
||||
~
|
||||
~ Copyright (C) 2012-2015 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~ Copyright (C) 2012-2014 Mariotaku Lee <mariotaku.lee@gmail.com>
|
||||
~
|
||||
~ 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
|
||||
|
@ -17,54 +17,108 @@
|
|||
~ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
-->
|
||||
|
||||
<LinearLayout
|
||||
<org.mariotaku.twidere.view.ColorLabelRelativeLayout
|
||||
android:id="@+id/itemContent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:padding="@dimen/element_spacing_normal">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
android:paddingEnd="@dimen/element_spacing_normal"
|
||||
android:paddingLeft="0dp"
|
||||
android:paddingRight="@dimen/element_spacing_normal"
|
||||
android:paddingStart="0dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/element_spacing_xsmall"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
tools:text="Sample list"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/createdBy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingTop="@dimen/element_spacing_xsmall"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="Created by Mariotaku"/>
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:padding="@dimen/element_spacing_normal"
|
||||
app:ignorePadding="true"
|
||||
tools:context=".adapter.ParcelableUsersAdapter">
|
||||
|
||||
<org.mariotaku.twidere.view.ProfileImageView
|
||||
android:id="@+id/profileImage"
|
||||
style="?profileImageStyle"
|
||||
android:layout_width="@dimen/icon_size_card_list_item"
|
||||
android:layout_height="@dimen/icon_size_card_list_item"
|
||||
android:layout_weight="0"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_marginEnd="@dimen/element_spacing_normal"
|
||||
android:layout_marginRight="@dimen/element_spacing_normal"
|
||||
android:contentDescription="@string/profile_image"
|
||||
android:scaleType="fitCenter"/>
|
||||
</LinearLayout>
|
||||
android:scaleType="fitCenter"
|
||||
tools:src="@mipmap/ic_launcher"/>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/nameContainer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentTop="true"
|
||||
android:layout_alignWithParentIfMissing="true"
|
||||
android:layout_gravity="start|center_vertical"
|
||||
android:layout_toEndOf="@+id/profileImage"
|
||||
android:layout_toRightOf="@+id/profileImage"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical">
|
||||
|
||||
<org.mariotaku.twidere.view.TimelineContentTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorPrimary"
|
||||
android:textStyle="bold"
|
||||
tools:text="List"/>
|
||||
|
||||
<org.mariotaku.twidere.view.TimelineContentTextView
|
||||
android:id="@+id/createdBy"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"
|
||||
tools:text="Created by user"/>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/nameContainer"
|
||||
android:layout_alignStart="@+id/nameContainer"
|
||||
android:layout_below="@+id/nameContainer"
|
||||
android:paddingTop="@dimen/element_spacing_small"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:textColor="?android:attr/textColorSecondary"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignLeft="@+id/description"
|
||||
android:layout_alignStart="@+id/description"
|
||||
android:layout_below="@id/description"
|
||||
android:orientation="horizontal"
|
||||
android:paddingTop="@dimen/element_spacing_small">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/membersCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_following"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableStart="@drawable/ic_indicator_following"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/subscribersCount"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:drawableLeft="@drawable/ic_indicator_followers"
|
||||
android:drawablePadding="4dp"
|
||||
android:drawableStart="@drawable/ic_indicator_followers"
|
||||
android:singleLine="true"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"/>
|
||||
</LinearLayout>
|
||||
|
||||
</org.mariotaku.twidere.view.ColorLabelRelativeLayout>
|
Loading…
Reference in New Issue