Search in sources :

Example 31 with User

use of com.google.api.ads.admanager.axis.v202108.User in project Douya by DreaminginCodeZH.

the class NavigationAccountListLayout method bind.

public void bind() {
    List<Account> accountList = new ArrayList<>(Arrays.asList(AccountUtils.getAccounts()));
    accountList.remove(AccountUtils.getActiveAccount());
    Account recentOneAccount = AccountUtils.getRecentOneAccount();
    if (recentOneAccount != null) {
        accountList.remove(recentOneAccount);
    }
    Account recentTwoAccount = AccountUtils.getRecentTwoAccount();
    if (recentTwoAccount != null) {
        accountList.remove(recentTwoAccount);
    }
    if (recentOneAccount != null) {
        accountList.add(recentOneAccount);
    }
    if (recentTwoAccount != null) {
        accountList.add(recentTwoAccount);
    }
    int i = 0;
    for (final Account account : accountList) {
        if (i >= mAccountList.getChildCount()) {
            ViewUtils.inflateInto(R.layout.navigation_account_item, mAccountList);
        }
        View accountLayout = mAccountList.getChildAt(i);
        accountLayout.setVisibility(VISIBLE);
        AccountLayoutHolder holder = (AccountLayoutHolder) accountLayout.getTag();
        if (holder == null) {
            holder = new AccountLayoutHolder(accountLayout);
            accountLayout.setTag(holder);
        }
        User user = mAdapter.getUser(account);
        if (user != null) {
            ImageUtils.loadNavigationAccountListAvatar(holder.avatarImage, user.getLargeAvatarOrAvatar());
        } else {
            holder.avatarImage.setImageResource(R.drawable.avatar_icon_40dp);
        }
        holder.nameText.setText(mAdapter.getPartialUser(account).name);
        accountLayout.setOnClickListener(view -> {
            if (mListener != null) {
                mListener.switchToAccount(account);
            }
        });
        ++i;
    }
    ViewUtils.setVisibleOrGone(mDividerView, i > 0);
    for (int count = mAccountList.getChildCount(); i < count; ++i) {
        mAccountList.getChildAt(i).setVisibility(GONE);
    }
}
Also used : Account(android.accounts.Account) User(me.zhanghai.android.douya.network.api.info.apiv2.User) SimpleUser(me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser) ArrayList(java.util.ArrayList) ImageView(android.widget.ImageView) BindView(butterknife.BindView) View(android.view.View) TextView(android.widget.TextView)

Example 32 with User

use of com.google.api.ads.admanager.axis.v202108.User in project Douya by DreaminginCodeZH.

the class ProfileActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    overridePendingTransition(0, 0);
    // Calls ensureSubDecor().
    findViewById(android.R.id.content);
    if (savedInstanceState == null) {
        Intent intent = getIntent();
        String userIdOrUid = intent.getStringExtra(EXTRA_USER_ID_OR_UID);
        SimpleUser simpleUser = intent.getParcelableExtra(EXTRA_SIMPLE_USER);
        User user = intent.getParcelableExtra(EXTRA_USER_INFO);
        mFragment = ProfileFragment.newInstance(userIdOrUid, simpleUser, user);
        FragmentUtils.add(mFragment, this, android.R.id.content);
    } else {
        mFragment = FragmentUtils.findById(this, android.R.id.content);
    }
}
Also used : SimpleUser(me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser) SimpleUser(me.zhanghai.android.douya.network.api.info.apiv2.SimpleUser) User(me.zhanghai.android.douya.network.api.info.apiv2.User) Intent(android.content.Intent)

Example 33 with User

use of com.google.api.ads.admanager.axis.v202108.User in project Douya by DreaminginCodeZH.

the class ProfileBroadcastsLayout method bind.

public void bind(User user, List<Broadcast> broadcastList) {
    Context context = getContext();
    View.OnClickListener viewMoreListener = view -> context.startActivity(BroadcastListActivity.makeIntent(user, context));
    mTitleText.setOnClickListener(viewMoreListener);
    mViewMoreText.setOnClickListener(viewMoreListener);
    int i = 0;
    for (Broadcast broadcast : broadcastList) {
        if (i >= BROADCAST_COUNT_MAX) {
            break;
        }
        if (broadcast.rebroadcastedBroadcast != null) {
            continue;
        }
        if (i >= mBroadcastList.getChildCount()) {
            ViewUtils.inflateInto(R.layout.profile_broadcast_item, mBroadcastList);
        }
        View broadcastLayout = mBroadcastList.getChildAt(i);
        broadcastLayout.setVisibility(VISIBLE);
        BroadcastLayoutHolder holder = (BroadcastLayoutHolder) broadcastLayout.getTag();
        if (holder == null) {
            holder = new BroadcastLayoutHolder(broadcastLayout);
            broadcastLayout.setTag(holder);
            ViewUtils.setTextViewLinkClickable(holder.textText);
        }
        // HACK: Should not change on rebind.
        if (holder.boundBroadcastId != broadcast.id) {
            SizedImageItem image = null;
            if (broadcast.attachment != null) {
                image = broadcast.attachment.image;
            }
            if (image == null) {
                List<? extends SizedImageItem> images = broadcast.attachment != null && broadcast.attachment.imageList != null ? broadcast.attachment.imageList.images : broadcast.images;
                if (images.size() > 0) {
                    image = images.get(0);
                }
            }
            if (image != null) {
                holder.image.setVisibility(VISIBLE);
                ImageUtils.loadImage(holder.image, image);
            } else {
                holder.image.setVisibility(GONE);
            }
            CharSequence text = broadcast.getTextWithEntities(context);
            if (TextUtils.isEmpty(text) && broadcast.attachment != null) {
                text = broadcast.attachment.title;
            }
            holder.textText.setText(text);
            boolean hasTime = !TextUtils.isEmpty(broadcast.createTime);
            ViewUtils.setVisibleOrGone(holder.timeText, hasTime);
            if (hasTime) {
                holder.timeText.setDoubanTime(broadcast.createTime);
            }
            ViewUtils.setVisibleOrGone(holder.timeActionSpace, hasTime);
            holder.actionText.setText(broadcast.action);
            broadcastLayout.setOnClickListener(view -> context.startActivity(BroadcastActivity.makeIntent(broadcast, context)));
            holder.boundBroadcastId = broadcast.id;
        }
        ++i;
    }
    ViewUtils.setVisibleOrGone(mBroadcastList, i != 0);
    ViewUtils.setVisibleOrGone(mEmptyView, i == 0);
    if (user.broadcastCount > i) {
        mViewMoreText.setText(context.getString(R.string.view_more_with_count_format, user.broadcastCount));
    } else {
        mViewMoreText.setVisibility(GONE);
    }
    for (int count = mBroadcastList.getChildCount(); i < count; ++i) {
        mBroadcastList.getChildAt(i).setVisibility(GONE);
    }
}
Also used : Context(android.content.Context) Context(android.content.Context) ImageUtils(me.zhanghai.android.douya.util.ImageUtils) LinearLayout(android.widget.LinearLayout) BroadcastListActivity(me.zhanghai.android.douya.broadcast.ui.BroadcastListActivity) ButterKnife(butterknife.ButterKnife) ViewUtils(me.zhanghai.android.douya.util.ViewUtils) TimeTextView(me.zhanghai.android.douya.ui.TimeTextView) ImageView(android.widget.ImageView) TextUtils(android.text.TextUtils) R(me.zhanghai.android.douya.R) BindView(butterknife.BindView) User(me.zhanghai.android.douya.network.api.info.apiv2.User) List(java.util.List) TextView(android.widget.TextView) AttributeSet(android.util.AttributeSet) BroadcastActivity(me.zhanghai.android.douya.broadcast.ui.BroadcastActivity) View(android.view.View) SizedImageItem(me.zhanghai.android.douya.ui.SizedImageItem) Broadcast(me.zhanghai.android.douya.network.api.info.frodo.Broadcast) FriendlyCardView(me.zhanghai.android.douya.ui.FriendlyCardView) SizedImageItem(me.zhanghai.android.douya.ui.SizedImageItem) Broadcast(me.zhanghai.android.douya.network.api.info.frodo.Broadcast) TimeTextView(me.zhanghai.android.douya.ui.TimeTextView) ImageView(android.widget.ImageView) BindView(butterknife.BindView) TextView(android.widget.TextView) View(android.view.View) FriendlyCardView(me.zhanghai.android.douya.ui.FriendlyCardView)

Example 34 with User

use of com.google.api.ads.admanager.axis.v202108.User in project fastjson by alibaba.

the class Issue3132 method test_for_issue.

public void test_for_issue() throws Exception {
    User user = new User();
    user.setId(9);
    user.setName("asdffsf");
    System.out.println(JSONObject.toJSONString(user));
}
Also used : User(com.alibaba.json.bvtVO.一个中文名字的包.User)

Example 35 with User

use of com.google.api.ads.admanager.axis.v202108.User in project openstack4j by ContainX.

the class KeystoneUserServiceTests method getUser_byName_byDomainId_NotExist_Test.

/**
 * returns null for an non-existing user when the user specified by name and domain.
 *
 * @throws Exception
 */
public void getUser_byName_byDomainId_NotExist_Test() throws Exception {
    respondWith(JSON_USER_GET_BYNAME_BYDOMAINID_NOT_EXIST);
    User user = osv3().identity().users().getByName(USER_NAME, USER_DOMAIN_ID);
    assertNull(user);
}
Also used : KeystoneUser(org.openstack4j.openstack.identity.v3.domain.KeystoneUser) User(org.openstack4j.model.identity.v3.User)

Aggregations

User (pl.plajer.villagedefense3.User)30 Player (org.bukkit.entity.Player)18 User (org.gluu.oxtrust.model.scim2.User)17 EventHandler (org.bukkit.event.EventHandler)11 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)10 ScimPatchUser (org.gluu.oxtrust.model.scim2.ScimPatchUser)10 User (org.openstack4j.model.identity.v3.User)10 StatementBuilder (com.google.api.ads.admanager.axis.utils.v202108.StatementBuilder)8 DuplicateEntryException (org.gluu.site.ldap.exception.DuplicateEntryException)8 Arena (pl.plajer.villagedefense3.arena.Arena)8 ArrayList (java.util.ArrayList)7 User (me.zhanghai.android.douya.network.api.info.apiv2.User)7 EntryPersistenceException (org.gluu.site.ldap.persistence.exception.EntryPersistenceException)7 User (com.google.api.ads.admanager.axis.v202108.User)6 UserServiceInterface (com.google.api.ads.admanager.axis.v202108.UserServiceInterface)6 User (com.google.api.ads.admanager.axis.v202111.User)6 UserServiceInterface (com.google.api.ads.admanager.axis.v202111.UserServiceInterface)6 User (com.google.api.ads.admanager.axis.v202202.User)6 UserServiceInterface (com.google.api.ads.admanager.axis.v202202.UserServiceInterface)6 Date (java.util.Date)6