android.view.animation.LinearInterpolator#android.view.ViewGroup源码实例Demo

下面列出了android.view.animation.LinearInterpolator#android.view.ViewGroup 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: MediaChooser   文件: VideoFragment.java
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {

        if (mView == null) {
            mView = inflater.inflate(R.layout.view_grid_layout_media_chooser, container, false);

            getActivity().getWindow().setBackgroundDrawable(null);

            mVideoGridView = (GridView) mView.findViewById(R.id.gridViewFromMediaChooser);

            if (getArguments() != null) {
                initVideos(getArguments().getString("name"));
            } else {
                initVideos();
            }

        } else {
            if (mView.getParent() != null) {
                ((ViewGroup) mView.getParent()).removeView(mView);
            }
            if (mVideoAdapter == null || mVideoAdapter.getCount() == 0) {
                Toast.makeText(getActivity(), getActivity().getString(R.string.no_media_file_available), Toast.LENGTH_SHORT).show();
            }
        }

        return mView;
    }
 
源代码2 项目: smooth-app-bar-layout   文件: ScrollFlag.java
public ScrollFlag(AppBarLayout layout) {
  if (layout != null) {
    int i = 0;
    for (int z = layout.getChildCount(); i < z; ++i) {
      View child = layout.getChildAt(i);
      ViewGroup.LayoutParams layoutParams = child.getLayoutParams();
      if (layoutParams instanceof AppBarLayout.LayoutParams) {
        AppBarLayout.LayoutParams childLp = (AppBarLayout.LayoutParams) layoutParams;
        int flags = childLp.getScrollFlags();
        if ((flags & AppBarLayout.LayoutParams.SCROLL_FLAG_SCROLL) != 0) {
          vView = child;
          mFlags = flags;
          break;
        }
      }
    }
  }
}
 
源代码3 项目: iGap-Android   文件: FragmentShowImage.java
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    realmShowImage = Realm.getDefaultInstance();

    //View view = inflater.inflate(R.layout.activity_show_image, container, false);
    //exitFragmentTransition = FragmentTransition.with(this).duration(200).interpolator(new LinearOutSlowInInterpolator()).to(view.findViewById(R.id.asi_view_pager)).start(savedInstanceState);
    //
    //exitFragmentTransition.exitListener(new AnimatorListenerAdapter() {
    //    @Override
    //    public void onAnimationStart(Animator animation) {
    //        Log.d("FFFFFFF", "onAnimationStart: ");
    //    }
    //
    //    @Override
    //    public void onAnimationEnd(Animator animation) {
    //        Log.d("FFFFFFF", "onAnimationEnd: ");
    //    }
    //}).interpolator(new FastOutSlowInInterpolator());
    //exitFragmentTransition.startExitListening(view.findViewById(R.id.rooShowImage));

    return inflater.inflate(R.layout.activity_show_image, container, false);
}
 
源代码4 项目: Telegram-FOSS   文件: FloatingToolbar.java
private static void updateMenuItemButton(View menuItemButton, MenuItem menuItem, int iconTextSpacing) {
    ViewGroup viewGroup = (ViewGroup) menuItemButton;
    final TextView buttonText = (TextView) viewGroup.getChildAt(0);
    buttonText.setEllipsize(null);
    if (TextUtils.isEmpty(menuItem.getTitle())) {
        buttonText.setVisibility(View.GONE);
    } else {
        buttonText.setVisibility(View.VISIBLE);
        buttonText.setText(menuItem.getTitle());
    }
    buttonText.setPaddingRelative(0, 0, 0, 0);
    /*final CharSequence contentDescription = menuItem.getContentDescription(); TODO
    if (TextUtils.isEmpty(contentDescription)) {
        menuItemButton.setContentDescription(menuItem.getTitle());
    } else {
        menuItemButton.setContentDescription(contentDescription);
    }*/
}
 
源代码5 项目: MissZzzReader   文件: BookcaseDragAdapter.java
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder;
    if (convertView == null) {
        viewHolder = new ViewHolder();
        convertView = LayoutInflater.from(mContext).inflate(mResourceId, null);
        viewHolder.ivBookImg =  convertView.findViewById(R.id.iv_book_img);
        viewHolder.tvBookName = convertView.findViewById(R.id.tv_book_name);
        viewHolder.tvNoReadNum =  convertView.findViewById(R.id.tv_no_read_num);
        viewHolder.ivDelete = convertView.findViewById(R.id.iv_delete);
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }
    initView(position, viewHolder);
    return convertView;
}
 
private static ArrayList<View> findViewsWithTag(String TAG, ViewGroup rootView,
                                                ArrayList<View> views) {
    Object tag = rootView.getTag();
    if (tag != null && tag.equals(TAG)) {
        views.add(rootView);
    }

    for (int i = 0; i < rootView.getChildCount(); i++) {
        View v = rootView.getChildAt(i);
        tag = v.getTag();
        if (tag != null && tag.equals(TAG)) {
            views.add(v);
        }

        if (v instanceof ViewGroup) {
            findViewsWithTag(TAG, (ViewGroup) v, views);
        }
    }

    return views;
}
 
源代码7 项目: funcodetuts   文件: PageFragment.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    View view = inflater.inflate(R.layout.fragment_page, container, false);

    RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.main_recycler);
    LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity().getBaseContext());
    recyclerView.setLayoutManager(linearLayoutManager);
    recyclerView.setHasFixedSize(true);

    List<String> list = new ArrayList<>();

    for (int i = 0; i < 10; i++) {
        list.add("Item " + i);
    }

    SimpleRecyclerAdapter adapter = new SimpleRecyclerAdapter(list);
    recyclerView.setAdapter(adapter);
    adapter.setOnItemTapListener(mListItemClickListener);
    return view;
}
 
源代码8 项目: AndroidChromium   文件: AutofillLocalCardEditor.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
        Bundle savedInstanceState) {
    View v = super.onCreateView(inflater, container, savedInstanceState);

    mNameLabel = (CompatibilityTextInputLayout) v.findViewById(R.id.credit_card_name_label);
    mNameText = (EditText) v.findViewById(R.id.credit_card_name_edit);
    mNumberLabel = (CompatibilityTextInputLayout) v.findViewById(R.id.credit_card_number_label);
    mNumberText = (EditText) v.findViewById(R.id.credit_card_number_edit);

    // Set text watcher to format credit card number
    mNumberText.addTextChangedListener(new CreditCardNumberFormattingTextWatcher());

    mExpirationMonth = (Spinner) v.findViewById(R.id.autofill_credit_card_editor_month_spinner);
    mExpirationYear = (Spinner) v.findViewById(R.id.autofill_credit_card_editor_year_spinner);

    addSpinnerAdapters();
    addCardDataToEditFields();
    initializeButtons(v);
    return v;
}
 
源代码9 项目: Ruisi   文件: ForumsAdapter.java
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    CircleImageView imageView; // 声明ImageView的对象
    if (convertView == null) {
        imageView = new CircleImageView(context);
        AbsListView.LayoutParams p = new AbsListView.LayoutParams(itemWidth, itemWidth);
        imageView.setLayoutParams(p);
        imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
    } else {
        imageView = (CircleImageView) convertView;
    }

    Picasso.get()
            .load(ds.get(position).imgSrc)
            .placeholder(R.drawable.image_placeholder)
            .into(imageView);
    return imageView;
}
 
源代码10 项目: io2015-codelabs   文件: RecipeActivity.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.ingredients_fragment, container, false);

    this.recipe = ((RecipeActivity)getActivity()).recipe;

    TableLayout table = (TableLayout)rootView.findViewById(R.id.ingredientsTable);
    for (Recipe.Ingredient ingredient : recipe.getIngredients()) {
        TableRow row = (TableRow)inflater.inflate(R.layout.ingredients_row, null);
        ((TextView)row.findViewById(R.id.attrib_name)).setText(ingredient.getAmount());
        ((TextView)row.findViewById(R.id.attrib_value)).setText(ingredient.getDescription());
        table.addView(row);
    }

    return rootView;
}
 
源代码11 项目: ByWebView   文件: StatusBarUtil.java
/**
 * 设置状态栏颜色
 *
 * @param activity       需要设置的activity
 * @param color          状态栏颜色值
 * @param statusBarAlpha 状态栏透明度
 */

public static void setColor(Activity activity, @ColorInt int color, int statusBarAlpha) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
        activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        activity.getWindow().setStatusBarColor(calculateStatusColor(color, statusBarAlpha));
    } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        activity.getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
        ViewGroup decorView = (ViewGroup) activity.getWindow().getDecorView();
        int count = decorView.getChildCount();
        if (count > 0 && decorView.getChildAt(count - 1) instanceof StatusBarView) {
            decorView.getChildAt(count - 1).setBackgroundColor(calculateStatusColor(color, statusBarAlpha));
        } else {
            StatusBarView statusView = createStatusBarView(activity, color, statusBarAlpha);
            decorView.addView(statusView);
        }
        setRootView(activity);
    }
}
 
源代码12 项目: smart-farmer-android   文件: ViewUtil.java
public static void resetSize(View view, int width, int height){
    if (view == null) {
        return;
    }
    ViewGroup.LayoutParams params = view.getLayoutParams();
    if (params == null){
        params = new ViewGroup.LayoutParams(width, height);
        view.setLayoutParams(params);
        return;
    }
    boolean hasChanged = false;
    if (params.width != width){
        params.width = width;
        hasChanged = true;
    }
    if (params.height != height){
        params.height = height;
        hasChanged = true;
    }
    if (hasChanged) {
        view.requestLayout();
    }
}
 
源代码13 项目: LoveTalkClient   文件: BlogDateAdapter.java
TextView getTextView() {
	//设置TextView的样式
	AbsListView.LayoutParams lp = new AbsListView.LayoutParams(
			ViewGroup.LayoutParams.WRAP_CONTENT, 64);
	TextView textView = new TextView(
			mContext);
	textView.setLayoutParams(lp);
	textView.setGravity(Gravity.CENTER_VERTICAL);
	//设置TextView的Padding值
	textView.setPadding(16, -10, 0, 32);
	//设置TextView的字体大小
	textView.setTextSize(14);
	//设置TextView的字体颜色
	textView.setTextColor(Color.WHITE);
	//设置字体加粗
	TextPaint txt = textView.getPaint();
	txt.setFakeBoldText(true);
	return textView;
}
 
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	View rowView = convertView;
	if (rowView == null) {
		LayoutInflater inflater = context.getLayoutInflater();
		rowView = inflater.inflate(R.layout.rowlayout, null);
	}

	TextView textView = (TextView) rowView.findViewById(R.id.label);
	ImageView imageView = (ImageView) rowView.findViewById(R.id.icon);
	String s = names[position];
	textView.setText(s);
	if (s.startsWith("Windows7") || s.startsWith("iPhone")
			|| s.startsWith("Solaris")) {
		imageView.setImageResource(R.drawable.no);
	} else {
		imageView.setImageResource(R.drawable.ok);
	}

	return rowView;
}
 
源代码15 项目: privacy-friendly-pedometer   文件: ReportAdapter.java
@Override
public ReportAdapter.ViewHolder onCreateViewHolder(ViewGroup parent,
                                                   int viewType) {
    View v;
    ViewHolder vh;
    switch (viewType) {
        case TYPE_CHART:
            v = LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.card_activity_bar_chart, parent, false);
            vh = new CombinedChartViewHolder(v);
            break;
        case TYPE_DAY_CHART:
            v = LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.card_activity_chart, parent, false);
            vh = new ChartViewHolder(v);
            break;
        case TYPE_SUMMARY:
        default:
            v = LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.card_activity_summary, parent, false);
            vh = new SummaryViewHolder(v);
            break;
    }
    return vh;
}
 
源代码16 项目: MousePaint   文件: Delegate.java
/**
 * 显示模糊背景
 */
protected void showShowdown() {

    ViewHelper.setTranslationY(mRootView, 0);
    mEffect.effect(mParentVG,mBg);
    ViewGroup.LayoutParams lp =
            new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);

    if(mBg.getParent()!= null){
        mParentVG.removeView(mBg);
    }

    mParentVG.addView(mBg, lp);
    ViewHelper.setAlpha(mBg, 0);
    ObjectAnimator objectAnimator = ObjectAnimator.ofFloat(mBg, "alpha", 0, 1);
    objectAnimator.setDuration(400);
    objectAnimator.start();
}
 
源代码17 项目: osmdroid   文件: ExpandableListAdapter.java
@Override
public View getGroupView(int groupPosition, boolean isExpanded,
                         View convertView, ViewGroup parent) {
    String headerTitle = (String) getGroup(groupPosition);
    if (convertView == null) {
        LayoutInflater infalInflater = (LayoutInflater) this._context
            .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        convertView = infalInflater.inflate(R.layout.list_group, null);
    }

    TextView lblListHeader = convertView
        .findViewById(R.id.lblListHeader);
    lblListHeader.setTypeface(null, Typeface.BOLD);
    lblListHeader.setText(headerTitle);

    return convertView;
}
 
源代码18 项目: Muzesto   文件: AlbumFragment.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(
            R.layout.fragment_recyclerview, container, false);

    recyclerView = (RecyclerView) rootView.findViewById(R.id.recyclerview);
    fastScroller = (FastScroller) rootView.findViewById(R.id.fastscroller);
    FloatingActionButton fab = (FloatingActionButton) rootView.findViewById(R.id.fab);
    fab.hide();
    ImageView backdrop = (ImageView) rootView.findViewById(R.id.white_backdrop);
    backdrop.setVisibility(View.VISIBLE);

    setLayoutManager();

    if (getActivity() != null)
        new loadAlbums().execute("");
    return rootView;
}
 
源代码19 项目: ProjectX   文件: ViewsPagerAdapter.java
@NonNull
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
    final ViewHolder holder = mItems.get(position);
    holder.mPosition = position;
    holder.mNeedRebind = false;
    holder.mPositionChanged = false;
    holder.mRemoved = false;
    final View view = holder.itemView;
    onBindView(view, position);
    container.addView(view);
    mItemsInLayout.add(holder);
    return holder;
}
 
@Nullable
@Override
public Animator createDisappear(@NonNull ViewGroup sceneRoot, @NonNull View view) {
  if (!scaleOnDisappear) {
    return null;
  }

  if (growing) {
    return createScaleAnimator(view, outgoingStartScale, outgoingEndScale);
  } else {
    return createScaleAnimator(view, incomingEndScale, incomingStartScale);
  }
}
 
@NonNull
@Override
public EntryItemViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
    return new EntryItemViewHolder(
            LayoutInflater.from(parent.getContext())
                    .inflate(R.layout.entry_item, parent, false));
}
 
源代码22 项目: imsdk-android   文件: RNMineFragment.java
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

    super.onCreateView(inflater, container, savedInstanceState);
    return mReactRootView;

}
 
源代码23 项目: ShareBox   文件: VerticalStepperView.java
private void prepareListView(Context context) {
	mListView = new RecyclerView(context);
	mAdapter = new ItemAdapter();

	mListView.setClipToPadding(false);
	mListView.setPadding(0, getResources().getDimensionPixelSize(R.dimen.stepper_margin_top), 0, 0);

	mListView.addItemDecoration(new VerticalSpaceItemDecoration(
			getResources().getDimensionPixelSize(R.dimen.vertical_stepper_item_space_height)));
	mListView.setLayoutManager(new LinearLayoutManager(context));
	mListView.setAdapter(mAdapter);

	addView(mListView, new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
}
 
源代码24 项目: Walk-In-Clinic-Android-App   文件: UserList.java
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    LayoutInflater inflater = context.getLayoutInflater();
    View listViewItem = inflater.inflate(R.layout.layout_user_list, null, true);

    TextView textViewName = (TextView) listViewItem.findViewById(R.id.textViewName);
    TextView textViewRole = (TextView) listViewItem.findViewById(R.id.textViewRole);
    TextView textViewUsername = (TextView) listViewItem.findViewById(R.id.textViewUsername);

    DataBaseUser user = users.get(position);
    textViewName.setText("Name: " + user.getName());
    textViewRole.setText("Role: " + String.valueOf(user.getRole()));
    textViewUsername.setText("Username: " + String.valueOf(user.getUsername()));
    return listViewItem;
}
 
源代码25 项目: timecat   文件: PlansFragment.java
@Override
protected View initViews(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    view = inflater.inflate(R.layout.fragment_routines, container, false);
    progressBar = view.findViewById(R.id.progress_bar);
    frameLayout = view.findViewById(R.id.fragment_container);
    mRefreshLayout = view.findViewById(R.id.refreshLayout);
    initView();

    return view;
}
 
源代码26 项目: Android-Applications-Info   文件: DetailFragment.java
/**
 * Boring view inflation / creation
 */
private View getServicesView(ViewGroup viewGroup, View convertView, int index) {
    ViewHolder viewHolder;
    if (!checkIfConvertViewMatch(convertView, SERVICES)) {
        convertView = mLayoutInflater.inflate(R.layout.detail_activities, viewGroup, false);

        viewHolder = new ViewHolder();
        viewHolder.currentViewType = SERVICES;
        viewHolder.imageView = (ImageView) convertView.findViewById(R.id.icon);
        viewHolder.textView1 = (TextView) convertView.findViewById(R.id.label);
        viewHolder.textView2 = (TextView) convertView.findViewById(R.id.name);
        viewHolder.textView3 = (TextView) convertView.findViewById(R.id.launchMode);
        convertView.findViewById(R.id.taskAffinity).setVisibility(View.GONE);
        convertView.findViewById(R.id.orientation).setVisibility(View.GONE);
        convertView.findViewById(R.id.softInput).setVisibility(View.GONE);
        convertView.findViewById(R.id.launch).setVisibility(View.GONE);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }

    final ServiceInfo serviceInfo = mPackageInfo.services[index];
    convertView.setBackgroundColor(index % 2 == 0 ? mColorGrey1 : mColorGrey2);

    //Label
    viewHolder.textView1.setText(serviceInfo.loadLabel(mPackageManager));

    //Name
    viewHolder.textView2.setText(serviceInfo.name.replaceFirst(mPackageName, ""));

    //Icon
    viewHolder.imageView.setImageDrawable(serviceInfo.loadIcon(mPackageManager));

    //Flags
    viewHolder.textView3.setText(getString(R.string.flags) + ": " + Utils.getServiceFlagsString(serviceInfo.flags));

    return convertView;
}
 
public void setImageMaximumHeight(int maximumHeight) {
    imageMaximumHeight = maximumHeight;

    View space = header.findViewById(R.id.space);
    ViewGroup.LayoutParams spaceParams = space.getLayoutParams();
    spaceParams.height = maximumHeight;
    space.setLayoutParams(spaceParams);

    ViewGroup.LayoutParams parallaxParams = parallaxScrimageView.getLayoutParams();
    parallaxParams.height = maximumHeight;
    parallaxScrimageView.setLayoutParams(parallaxParams);
}
 
源代码28 项目: Fatigue-Detection   文件: EffectAdapter.java
@Override
public EffectHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = LayoutInflater.from(context).inflate(R.layout.effect_item_layout,
            parent, false);
    EffectHolder viewHolder = new EffectHolder(view);
    viewHolder.thumbImage = (ImageView) view
            .findViewById(R.id.effect_thumb_image);
    viewHolder.filterRoot = (LinearLayout) view
            .findViewById(R.id.effect_root);
    viewHolder.filterImg = (FrameLayout) view.findViewById(R.id.effect_img_panel);
    return viewHolder;
}
 
源代码29 项目: openvidonn   文件: BluetoothDevicesFragment.java
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    Log.d(TAG, "onCreateView()");
    View view = inflater.inflate(R.layout.fragment_bluetoothdevices, container, false);

    // Set the adapter
    mListView = (AbsListView) view.findViewById(android.R.id.list);
    ((AdapterView<ListAdapter>) mListView).setAdapter(devicesList);

    return view;
}
 
源代码30 项目: AndroidUiKit   文件: MultiTypeLoadMoreAdapter.java
@NonNull
@Override
protected final VH onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
    VH viewHolder = createViewHolder(inflater, parent);
    viewHolder.mListener = mListener;
    return viewHolder;
}