Java 类android.view.View 实例源码

项目:CXJPadProject    文件:YRecycleview.java   
@Override
public void onChanged() {
    Adapter<?> adapter = getAdapter();
    if (adapter != null && mEmptyView != null) {
        int emptyCount = 0;
        if (pullRefreshEnabled) {
            emptyCount++;
        }
        if (loadMoreEnabled) {
            emptyCount++;
        }
        if (adapter.getItemCount() == emptyCount) {
            mEmptyView.setVisibility(View.VISIBLE);
            YRecycleview.this.setVisibility(View.GONE);
        } else {
            mEmptyView.setVisibility(View.GONE);
            YRecycleview.this.setVisibility(View.VISIBLE);
        }
    }
    if (mWrapAdapter != null) {
        mWrapAdapter.notifyDataSetChanged();
    }
}
项目:Musicoco    文件:RecentMostPlayActivity.java   
private void initViews() {

        list = (RecyclerView) findViewById(R.id.rmp_a_list);

        adapter = new RMPAdapter(this, data);
        list.setLayoutManager(new LinearLayoutManager(this));

        line = findViewById(R.id.rmp_a_line);
        title = (TextView) findViewById(R.id.rmp_a_title);
        toolbar = (Toolbar) findViewById(R.id.rmp_a_toolbar);
        setSupportActionBar(toolbar);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);

        first = new FirstThreeViewHolder(this, FirstThreeViewHolder.FIRST);
        second = new FirstThreeViewHolder(this, FirstThreeViewHolder.SECOND);
        third = new FirstThreeViewHolder(this, FirstThreeViewHolder.THIRD);
        first.setVisible(View.INVISIBLE);
        second.setVisible(View.INVISIBLE);
        third.setVisible(View.INVISIBLE);

    }
项目:face-landmark-android    文件:OrnamentAdapter.java   
@Override
public void onBindViewHolder(MyViewHolder holder, final int position) {
    final Ornament bean = mData.get(position);
    if (bean != null) {
        holder.ivImg.setColorFilter(Color.WHITE);
        holder.ivImg.setImageResource(bean.getImgResId());

        holder.ivImg.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (onItemClickListener != null) {
                    onItemClickListener.onItemClick(position);
                }
            }
        });
    } else {
        holder.ivImg.setImageResource(0);
    }
}
项目:GeekZone    文件:SpecialListAdapter.java   
@Override
public void onBindData2View(final StoriesBean data) {
    desc.setText(data.getTitle());
    if (data.getImages() != null
            && data.getImages().size() > 0) {
        avatar.setVisibility(View.VISIBLE);
        loadAvatar(data.getImages().get(0), avatar);
    } else {
        avatar.setVisibility(View.GONE);
    }
    hotContentView.setOnClickListener(
            new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Context context = v.getContext();
                    Intent intent = new Intent(context, ArticleDetailActivity.class);
                    intent.putExtra(EXTRA_ARTICLE_ID, data.getId());
                    intent.putExtra(EXTRA_ARTICLE_TYPE, EXTRA_TYPE_ZHIHU_NEWS);
                    context.startActivity(intent);
                }
            });
}
项目:EMQ-Android-Toolkit    文件:DashboardActivity.java   
@OnClick(R.id.fab)
    public void onClick() {
        if (!isConnected()){
            TipUtil.showSnackbar(mCoordinatorLayout, getString(R.string.hint_disconnect), getString(R.string.connect), new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    connect();
                }
            });
            return;
        }

        if (mCurrentMode == SUBSCRIPTION) {
//            startActivityForResult(SubscriptionActivity.class, SUBSCRIPTION);
            SubscriptionFragment subscriptionFragment = new SubscriptionFragment();
            subscriptionFragment.show(getSupportFragmentManager(), "Subscription");
        } else if (mCurrentMode == PUBLICATION) {
            startActivityForResult(PublicationActivity.class, PUBLICATION);
        }


    }
项目:chromium-for-android-56-debug-video    文件:CustomTabToolbar.java   
@Override
public boolean onLongClick(View v) {
    if (v == mCloseButton) {
        return showAccessibilityToast(v, getResources().getString(R.string.close_tab));
    } else if (v == mCustomActionButton) {
        return showAccessibilityToast(v, mCustomActionButton.getContentDescription());
    } else if (v == mTitleUrlContainer) {
        ClipboardManager clipboard = (ClipboardManager) getContext()
                .getSystemService(Context.CLIPBOARD_SERVICE);
        Tab tab = getCurrentTab();
        if (tab == null) return false;
        String url = tab.getOriginalUrl();
        ClipData clip = ClipData.newPlainText("url", url);
        clipboard.setPrimaryClip(clip);
        Toast.makeText(getContext(), R.string.url_copied, Toast.LENGTH_SHORT).show();
        return true;
    }
    return false;
}
项目:GitHub    文件:EasyPopup.java   
/**
 * 相对anchor view显示,适用 宽高不为match_parent
 * <p>
 * 注意:如果使用 VerticalGravity 和 HorizontalGravity 时,请确保使用之后 PopupWindow 没有超出屏幕边界,
 * 如果超出屏幕边界,VerticalGravity 和 HorizontalGravity 可能无效,从而达不到你想要的效果。
 *
 * @param anchor
 * @param vertGravity  垂直方向的对齐方式
 * @param horizGravity 水平方向的对齐方式
 * @param x            水平方向的偏移
 * @param y            垂直方向的偏移
 */
public void showAtAnchorView(@NonNull View anchor, @VerticalGravity final int vertGravity, @HorizontalGravity int horizGravity, int x, int y) {
    if (mPopupWindow == null) {
        return;
    }
    mAnchorView = anchor;
    mOffsetX = x;
    mOffsetY = y;
    mVerticalGravity = vertGravity;
    mHorizontalGravity = horizGravity;
    isOnlyGetWH = false;
    //处理背景变暗
    handleBackgroundDim();
    final View contentView = getContentView();
    addGlobalLayoutListener(contentView);
    contentView.measure(0, View.MeasureSpec.UNSPECIFIED);
    final int measuredW = contentView.getMeasuredWidth();
    final int measuredH = contentView.getMeasuredHeight();

    x = calculateX(anchor, horizGravity, measuredW, x);
    y = calculateY(anchor, vertGravity, measuredH, y);
    Log.i(TAG, "showAtAnchorView: w=" + measuredW + ",y=" + measuredH);
    PopupWindowCompat.showAsDropDown(mPopupWindow, anchor, x, y, Gravity.NO_GRAVITY);
}
项目:qmui    文件:QDEmptyViewFragment.java   
private void initTopBar() {
    mTopBar.addLeftBackImageButton().setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            popBackStack();
        }
    });

    // 切换其他情况的按钮
    mTopBar.addRightImageButton(R.mipmap.icon_topbar_overflow, R.id.topbar_right_change_button).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            showBottomSheetList();
        }
    });

    mTopBar.setTitle(mQDItemDescription.getName());
}
项目:APIJSON-Android-RxJava    文件:UserListFragment.java   
@Override
public void initEvent() {//必须调用
    super.initEvent();

    lvBaseList.setOnItemClickListener(new OnItemClickListener() {

        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            toActivity(UserActivity.createIntent(context, id));
        }
    });
}
项目:rongyunDemo    文件:UserDetailActivity.java   
private void initBlackListStatusView() {
    if (mIsFriendsRelationship) {
        Button rightButton = getHeadRightButton();
        rightButton.setBackgroundDrawable(getResources().getDrawable(R.drawable.main_activity_contact_more));
        rightButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(final View v) {
                RongIM.getInstance().getBlacklistStatus(mFriend.getUserId(), new RongIMClient.ResultCallback<RongIMClient.BlacklistStatus>() {
                    @Override
                    public void onSuccess(RongIMClient.BlacklistStatus blacklistStatus) {
                        SinglePopWindow morePopWindow = new SinglePopWindow(UserDetailActivity.this, mFriend, blacklistStatus);
                        morePopWindow.showPopupWindow(v);
                    }

                    @Override
                    public void onError(RongIMClient.ErrorCode e) {

                    }
                });
            }
        });
    }
}
项目:ZhidaoDaily-android    文件:PhotoActivity.java   
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_photo);
    ButterKnife.bind(this);
    setupActionBar(toolbar, "", true);
    final String url = getIntent().getStringExtra("imgUrl");
    with(this).load(url).into(mPhotoView);
    mPhotoView.setOnLongClickListener(new View.OnLongClickListener() {
        @Override
        public boolean onLongClick(View v) {
            savePic(url);
            return true;
        }
    });
}
项目:GitHub    文件:ContactsPage.java   
public boolean onKeyEvent(int keyCode, KeyEvent event) {
    try {
        int resId = ResHelper.getIdRes(activity, "llSearch");
        if (keyCode == KeyEvent.KEYCODE_BACK
                && event.getAction() == KeyEvent.ACTION_DOWN
                && activity.findViewById(resId).getVisibility() == View.VISIBLE) {
            activity.findViewById(resId).setVisibility(View.GONE);
            resId = ResHelper.getIdRes(activity, "llTitle");
            activity.findViewById(resId).setVisibility(View.VISIBLE);
            etSearch.setText("");
            return true;
        }
    } catch (Exception e) {
        SMSLog.getInstance().w(e);
    }
    return super.onKeyEvent(keyCode, event);
}
项目:NSMPlayer-Android    文件:EssayDetailActivity.java   
@Override
public void onVideoItemChangeToFullScreenClick(EssayAdapter.VideoViewHolder videoViewHolder) {
    // 这里这个ViewGroup 是Window的
    final ViewGroup vp = (ViewGroup)(findViewById(Window.ID_ANDROID_CONTENT));

    videoViewHolder.basicVideoView.setPlayer(null);

    final BasicVideoView newBasicVideoView = (BasicVideoView) View.inflate(this, R.layout.basic_videoview, null);
    newBasicVideoView.setPlayer(mPlayer);
    View changeToInsetScreen = newBasicVideoView.findViewById(R.id.changeToInsetScreen);
    changeToInsetScreen.setOnClickListener(this);

    final FrameLayout.LayoutParams lpParent = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    final FrameLayout frameLayout = new FrameLayout(this);
    frameLayout.setId(R.id.full_screen_id);

    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    lp.gravity = Gravity.CENTER;
    frameLayout.addView(newBasicVideoView, lp);
    vp.addView(frameLayout, lpParent);
    mPlayer.seekTo(mPlayer.getCurrentPosition() - 20);
}
项目:boohee_v5.6    文件:SportPlayActivity.java   
protected void initViews() {
    this.mVideoView = (ExVideoView) findViewById(R.id.video);
    this.mHeaderView = findViewById(R.id.header);
    this.mBtnBack = findViewById(R.id.btn_back);
    this.mVideoView.setExpandState(true);
    this.mVideoView.setStatus(2);
    this.mVideoView.setContinueVideo(this.mUri);
    this.mVideoView.getVideoView().setOnCompletionListener(new OnCompletionListener() {
        public void onCompletion(MediaPlayer mp) {
            SportPlayActivity.this.setResult(-1);
            SportPlayActivity.this.finish();
        }
    });
    this.mVideoView.getControllerView().addBindView(this.mHeaderView);
    this.mBtnBack.setOnClickListener(new OnClickListener() {
        public void onClick(View v) {
            SportPlayActivity.this.onBackPressed();
        }
    });
}
项目:GitHub    文件:Demo1Fragment.java   
@Override
public void onWidgetClick(View view) {
    tvAboutFragment.setText("");
    switch (view.getId()) {
        case R.id.btn_show_about_fragment:
            tvAboutFragment.setText("lastAdd: " + FragmentUtils.getLastAddFragment(getFragmentManager()).getClass().getSimpleName()
                    + "\nlastAddInStack: " + (FragmentUtils.getLastAddFragmentInStack(getFragmentManager()) != null ? FragmentUtils.getLastAddFragmentInStack(getFragmentManager()).getClass().getSimpleName() : "null")
                    + "\ntopShow: " + FragmentUtils.getTopShowFragment(getFragmentManager()).getClass().getSimpleName()
                    + "\ntopShowInStack: " + (FragmentUtils.getTopShowFragmentInStack(getFragmentManager()) != null ? FragmentUtils.getTopShowFragmentInStack(getFragmentManager()).getClass().getSimpleName() : "null")
                    + "\n---all of fragments---\n"
                    + FragmentUtils.getAllFragments(getFragmentManager()).toString()
                    + "\n----------------------\n\n"
                    + "---stack top---\n"
                    + FragmentUtils.getAllFragmentsInStack(getFragmentManager()).toString()
                    + "\n---stack bottom---\n\n"
            );
            break;
        case R.id.btn_hide_show:
            FragmentUtils.hideAllShowFragment(((FragmentActivity) getActivity()).rootFragment);
            break;
    }
}
项目:tenor-android-demo-search    文件:TagItemVH.java   
public TagItemVH(@NonNull View itemView, CTX context) {
    super(itemView, context);

    mImage = itemView.findViewById(R.id.it_iv_image);
    mName = itemView.findViewById(R.id.it_tv_name);
    mLoadingProgress = itemView.findViewById(R.id.it_pb_loading);

    itemView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            onClicked();
        }
    });
}
项目:Hotspot-master-devp    文件:ViewCompat.java   
public static void setLayerType(View view, int layerType) {
    view.setLayerType(layerType, null);
}
项目:ViewpagerMoreTabDemo    文件:ChooseTabActivityAdapter.java   
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
    int action = motionEvent.getAction();
    switch (action) {
        case MotionEvent.ACTION_DOWN: {
            recyclerview.startDrag(this);
            break;
        }
    }
    return false;
}
项目:S3-16-simone    文件:GoogleApiHelper.java   
/**
 * Initialization of the GoogleApiClient with Callbacks, Listeners and View for popups.
 * @param activity
 * @param view
 */
public void buildGoogleApiClient(FullscreenBaseGameActivity activity, View view) {
    mGoogleApiClient = new GoogleApiClient.Builder(context)
            .addConnectionCallbacks(activity)
            .addOnConnectionFailedListener(activity)
            .addScope(Games.SCOPE_GAMES)
            .setViewForPopups(view)
            .addApi(Games.API).build();
    mGoogleApiClient.connect();
}
项目:Cable-Android    文件:RegistrationActivity.java   
@Override
public void onClick(View v) {
  if (informationView.getVisibility() == View.VISIBLE) {
    informationView.setVisibility(View.GONE);
    informationToggleText.setText(R.string.RegistrationActivity_more_information);
  } else {
    informationView.setVisibility(View.VISIBLE);
    informationToggleText.setText(R.string.RegistrationActivity_less_information);
  }
}
项目:PlusGram    文件:StaggeredGridLayoutManager.java   
private void recycleFromEnd(RecyclerView.Recycler recycler, int line) {
    final int childCount = getChildCount();
    int i;
    for (i = childCount - 1; i >= 0; i--) {
        View child = getChildAt(i);
        if (mPrimaryOrientation.getDecoratedStart(child) >= line) {
            LayoutParams lp = (LayoutParams) child.getLayoutParams();
            // Don't recycle the last View in a span not to lose span's start/end lines
            if (lp.mFullSpan) {
                for (int j = 0; j < mSpanCount; j++) {
                    if (mSpans[j].mViews.size() == 1) {
                        return;
                    }
                }
                for (int j = 0; j < mSpanCount; j++) {
                    mSpans[j].popEnd();
                }
            } else {
                if (lp.mSpan.mViews.size() == 1) {
                    return;
                }
                lp.mSpan.popEnd();
            }
            removeAndRecycleView(child, recycler);
        } else {
            return;// done
        }
    }
}
项目:GitHub    文件:EmoticonsAdapter.java   
protected void updateUI(ViewHolder viewHolder, ViewGroup parent) {
    if(mDefalutItemHeight != mItemHeight){
        viewHolder.iv_emoticon.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, mItemHeight));
    }
    mItemHeightMax = this.mItemHeightMax != 0 ? this.mItemHeightMax : (int) (mItemHeight * mItemHeightMaxRatio);
    mItemHeightMin = this.mItemHeightMin != 0 ? this.mItemHeightMin : mItemHeight;
    int realItemHeight = ((View) parent.getParent()).getMeasuredHeight() / mEmoticonPageEntity.getLine();
    realItemHeight = Math.min(realItemHeight, mItemHeightMax);
    realItemHeight = Math.max(realItemHeight, mItemHeightMin);
    viewHolder.ly_root.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, realItemHeight));
}
项目:TheMovies    文件:MovieViewHolder.java   
public MovieViewHolder(View itemView, Activity activity, int numberOfColumns) {
    super(itemView);
    ButterKnife.bind(this, itemView);
    rootView = itemView;
    this.activity = activity;
    this.numberOfColumns = numberOfColumns;
    setListeners();
}
项目:GitHub    文件:CoreBaseActivity.java   
private View getContainer() {
    RelativeLayout container = new RelativeLayout(this);
    swipeBackLayout = new SwipeBackLayout(this);
    swipeBackLayout.setDragEdge(SwipeBackLayout.DragEdge.LEFT);
    ivShadow = new ImageView(this);
    ivShadow.setBackgroundColor(getResources().getColor(R.color.theme_black_7f));
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
    container.addView(ivShadow, params);
    container.addView(swipeBackLayout);
    swipeBackLayout.setOnSwipeBackListener((fa, fs) -> ivShadow.setAlpha(1 - fs));
    return container;
}
项目:iosched-reader    文件:SessionDetailFragment.java   
private void displaySpeakersData(SessionDetailModel data) {
    final ViewGroup speakersGroup = (ViewGroup) getActivity()
            .findViewById(R.id.session_speakers_block);

    // Remove all existing speakers (everything but first child, which is the header)
    for (int i = speakersGroup.getChildCount() - 1; i >= 1; i--) {
        speakersGroup.removeViewAt(i);
    }

    final LayoutInflater inflater = getActivity().getLayoutInflater();

    boolean hasSpeakers = false;

    List<SessionDetailModel.Speaker> speakers = data.getSpeakers();

    for (final SessionDetailModel.Speaker speaker : speakers) {

        String speakerHeader = speaker.getName();
        if (!TextUtils.isEmpty(speaker.getCompany())) {
            speakerHeader += ", " + speaker.getCompany();
        }

        final View speakerView = inflater
                .inflate(R.layout.speaker_detail, speakersGroup, false);
        final TextView speakerHeaderView = (TextView) speakerView
                .findViewById(R.id.speaker_header);
        final ImageView speakerImageView = (ImageView) speakerView
                .findViewById(R.id.speaker_image);
        final TextView speakerAbstractView = (TextView) speakerView
                .findViewById(R.id.speaker_abstract);
        final ImageView plusOneIcon = (ImageView) speakerView.findViewById(R.id.gplus_icon_box);
        final ImageView twitterIcon = (ImageView) speakerView.findViewById(
                R.id.twitter_icon_box);

        setUpSpeakerSocialIcon(speaker, twitterIcon, speaker.getTwitterUrl(),
                UIUtils.TWITTER_COMMON_NAME, UIUtils.TWITTER_PACKAGE_NAME);

        setUpSpeakerSocialIcon(speaker, plusOneIcon, speaker.getPlusoneUrl(),
                UIUtils.GOOGLE_PLUS_COMMON_NAME, UIUtils.GOOGLE_PLUS_PACKAGE_NAME);

        // A speaker may have both a Twitter and GPlus page, only a Twitter page or only a
        // GPlus page, or neither. By default, align the Twitter icon to the right and the GPlus
        // icon to its left. If only a single icon is displayed, align it to the right.
        determineSocialIconPlacement(plusOneIcon, twitterIcon);

        if (!TextUtils.isEmpty(speaker.getImageUrl()) && mSpeakersImageLoader != null) {
            mSpeakersImageLoader.loadImage(speaker.getImageUrl(), speakerImageView);
        }

        speakerHeaderView.setText(speakerHeader);
        speakerImageView.setContentDescription(
                getString(R.string.speaker_googleplus_profile, speakerHeader));
        UIUtils.setTextMaybeHtml(speakerAbstractView, speaker.getAbstract());

        if (!TextUtils.isEmpty(speaker.getUrl())) {
            speakerImageView.setEnabled(true);
            speakerImageView.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    Intent speakerProfileIntent = new Intent(Intent.ACTION_VIEW,
                            Uri.parse(speaker.getUrl()));
                    speakerProfileIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
                    UIUtils.preferPackageForIntent(getActivity(),
                            speakerProfileIntent,
                            UIUtils.GOOGLE_PLUS_PACKAGE_NAME);
                    startActivity(speakerProfileIntent);
                }
            });
        } else {
            speakerImageView.setEnabled(false);
            speakerImageView.setOnClickListener(null);
        }

        speakersGroup.addView(speakerView);
        hasSpeakers = true;
    }

    speakersGroup.setVisibility(hasSpeakers ? View.VISIBLE : View.GONE);
    updateEmptyView(data);
}
项目:2017.1-Trezentos    文件:CreateClassActivity.java   
public boolean confirmInformation(UserClassControl userClassControl, String className,
                                  String institution, String password,
                                  String cutOff, String sizeGroups,
                                  String addition) throws UserException {
    if(cutOff.isEmpty() || addition.isEmpty() || sizeGroups.isEmpty()){
        classNameField.setError("Preencha todos os campos!");
    }
    progressBar.setVisibility(View.GONE);
    String errorMessage;
    errorMessage = userClassControl.validateInformation(className, institution,
            cutOff, password, addition, sizeGroups);

    return verifyValidMessage(errorMessage);
}
项目:72GGames_Demo    文件:GameFragment.java   
@Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        //开启服务,下载apk
//        Intent intent = new Intent(getActivity(), DownLoadService.class);
//        intent.putExtra(Constant.DOWNLOAD,list.get(position).getDownLoadUrl());
//        getActivity().startService(intent);
    }
项目:Bailan    文件:DefaultFooter.java   
@Override
public View createView(LayoutInflater inflater, ViewGroup parent) {
    ViewGroup v = (ViewGroup) inflater.inflate(R.layout.prj_ptr_footer_default, parent, true);
    View child = v.getChildAt(v.getChildCount() - 1);
    mStringIndicator = (TextView) child.findViewById(R.id.tv_footer);
    progress_wheell = (ProgressWheel) v.findViewById(R.id.progress_wheell);
    default_rim_color = progress_wheell.getRimColor();
    return child;
}
项目:MovieApp    文件:HomeTvFragment.java   
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_home_tv, container, false);
    init(view);
    return view;
}
项目:GitHub    文件:UltimateRecyclerView.java   
/**
 * Set the parallax header of the recyclerview
 *
 * @param header the view
 */
public void setParallaxHeader(View header) {
    mHeader = new CustomRelativeWrapper(header.getContext());
    mHeader.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT));
    mHeader.addView(header, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
    isParallaxHeader = true;
}
项目:ChatExchange-old    文件:SlidingFragmentActivity.java   
@Override
public View findViewById(int id)
{
    View v = super.findViewById(id);
    if (v != null)
    {
        return v;
    }
    return mHelper.findViewById(id);
}
项目:Mix    文件:MainCoordinatorActivity.java   
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.btn_top:
            Intent intent_top = new Intent(MainCoordinatorActivity.this, BackTopActivity.class);
            startActivity(intent_top);
            break;
        case R.id.btn_zhihu:
            Intent intent_zhihu = new Intent(MainCoordinatorActivity.this, ZhiHuActivity.class);
            startActivity(intent_zhihu);
            break;
        case R.id.btn_cover:
            Intent intent_bottom = new Intent(MainCoordinatorActivity.this, BottomSheetActivity.class);
            startActivity(intent_bottom);
            break;
        case R.id.btn_delete:
            Intent intent_del = new Intent(MainCoordinatorActivity.this, SwipeDismissBehaviorActivity.class);
            startActivity(intent_del);
            break;
        case R.id.btn_vs:
            Intent intent_vs = new Intent(MainCoordinatorActivity.this,ViewSwitchActivity.class);
            startActivity(intent_vs);
            break;
        default:
            break;
    }
}
项目:QuizApp-Android    文件:QuestionActivity.java   
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.button1:
            Log.e("QuestionActivity", "Optiunea 1");
            checkAnswer(1);
            break;
        case R.id.button2:
            Log.e("QuestionActivity", "Optiunea 2");
            checkAnswer(2);
            break;
        case R.id.button3:
            Log.e("QuestionActivity", "Optiunea 3");
            checkAnswer(3);
            break;
        case R.id.button4:
            Log.e("QuestionActivity", "Optiunea 4");
            checkAnswer(4);
            break;
        case R.id.nextQuestion:
            Log.e("QuestionActivity", "Next Question");
            counter++;

            if (counter == 15) {
                showFragScore();
            } else {
                answer.setText("");
                currentIndexQuestion = randomNr(0, nrOfQuestions);//generate a random index
                qid = vectorOfIds.get(currentIndexQuestion);
                nextQuestion(qid);
                vectorOfIds.remove(currentIndexQuestion);
                nrOfQuestions--;
                break;
            }
    }
}
项目:LaunchEnr    文件:Workspace.java   
/**
 * At bind time, we use the rank (screenId) to compute x and y for hotseat items.
 * See {@link #addInScreen}.
 */
public void addInScreenFromBind(View child, ItemInfo info) {
    int x = info.cellX;
    int y = info.cellY;
    if (info.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT) {
        int screenId = (int) info.screenId;
        x = mLauncher.getHotseat().getCellXFromOrder(screenId);
        y = mLauncher.getHotseat().getCellYFromOrder(screenId);
    }
    addInScreen(child, info.container, info.screenId, x, y, info.spanX, info.spanY);
}
项目:QMUI_Android    文件:QDSpanFragment.java   
private void initTopBar() {
    mTopBar.addLeftBackImageButton().setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            popBackStack();
        }
    });

    mTopBar.setTitle(mQDItemDescription.getName());
}
项目:FloatingNew    文件:FloatingActionMenu.java   
/**
 * Finds and returns the main content view from the Activity context.
 *
 * @return the main content view
 */
public View getActivityContentView() {
    try {
        return ((Activity) mainActionView.getContext()).getWindow().getDecorView().findViewById(android.R.id.content);
    } catch (ClassCastException e) {
        throw new ClassCastException("Please provide an Activity context for this FloatingActionMenu.");
    }
}
项目:javaide    文件:TerminalKeyboard.java   
/**
 * Called by the framework when your view for showing candidates needs to
 * be generated, like {@link #onCreateInputView}.
 */
@Override
public View onCreateCandidatesView() {
    mCandidateView = new CandidateView(this);
    mCandidateView.setService(this);

    return mCandidateView;
}
项目:ChenYan    文件:JoinedUserActivity.java   
private void back() {
    toolbar.setNavigationOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            finish();
        }
    });
}
项目:LiteReader    文件:DailyArticleItemViewModel.java   
@Override
public void onViewAttached(View view) {
    getSelfView().getBinding().title.setText(article.data.title);
    getSelfView().getBinding().author.setText("作者:" + article.data.author);
    getSelfView().getBinding().content.setRichText(article.data.content);
    getSelfView().getBinding().ivRandom.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (onAction != null) onAction.call();
        }
    });
}
项目:mapbox-plugins-android    文件:MarkerManager.java   
@Override
public View getInfoWindow(Marker marker) {
  Collection collection = mAllMarkers.get(marker);
  if (collection != null && collection.mInfoWindowAdapter != null) {
    return collection.mInfoWindowAdapter.getInfoWindow(marker);
  }
  return null;
}