Java Code Examples for android.view.LayoutInflater

The following are top voted examples for showing how to use android.view.LayoutInflater. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: mapbox-plugins-android   File: PlaceAutocompleteFragment.java   View source code 7 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {
  Bundle bundle = getArguments();
  accessToken = bundle.getString(PlaceConstants.ACCESS_TOKEN);
  placeOptions = bundle.getParcelable(PlaceConstants.PLACE_OPTIONS);
  if (placeOptions == null) {
    // Increase geocoding limit
    placeOptions = PlaceOptions.builder().limit(10).build();
  }

  mode = placeOptions.viewMode();
  rootView = inflater.inflate(
    mode == PlaceOptions.MODE_CARDS ? R.layout.fragment_autocomplete_card
      : R.layout.fragment_autocomplete_full,
    container, false);

  bindViews();
  bindClickListeners();
  return rootView;
}
 
Example 2
Project: android-Ultra-Pull-To-Refresh   File: WithLongPressFragment.java   View source code 6 votes vote down vote up
/**
 * create a view from resource Xml file, and hold the view that may be used in displaying data.
 *
 * @param layoutInflater
 */
@Override
public View createView(LayoutInflater layoutInflater) {
    View view = layoutInflater.inflate(R.layout.with_long_press_list_view_item, null);
    mImageView = (CubeImageView) view.findViewById(R.id.with_long_press_list_image);
    return view;
}
 
Example 3
Project: UShareDemo   File: ShareCustomPopupWindow.java   View source code 6 votes vote down vote up
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder;
    if (convertView == null) {
        viewHolder = new ViewHolder();
        convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.layout_item_share, parent, false);
        viewHolder.ivShareLogo = (ImageView) convertView.findViewById(R.id.share_item_logo);
        viewHolder.tvShareName = (TextView) convertView.findViewById(R.id.share_item_name);
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }
    SharePlatform sharePlatform = getItem(position);
    if (sharePlatform != null) {
        viewHolder.ivShareLogo.setImageResource(sharePlatform.logoRes);
        viewHolder.tvShareName.setText(sharePlatform.name);
    }
    return convertView;
}
 
Example 4
Project: Android-Client   File: MatchCardView.java   View source code 6 votes vote down vote up
private void initialize() {
    LayoutInflater.from(getContext()).inflate(R.layout.match_card_view, this);

    /*
     * Get view references
     */
    profileImageView = (ImageView) findViewById(R.id.match_card_view_profile_image);
    nameTextView = (TextView) findViewById(R.id.match_card_view_name_text);
    ageTextView = (TextView) findViewById(R.id.match_card_view_age_text);
    filterImageView = (ImageView) findViewById(R.id.match_card_view_filter_image);
    bioTextView = (TextView) findViewById(R.id.match_card_view_bio_text);
    scoreTextView = (TextView) findViewById(R.id.match_card_view_score_text);

    rejectButton = (Button) findViewById(R.id.match_card_view_reject_button);
    acceptButton = (Button) findViewById(R.id.match_card_view_accept_button);
    chatButton = (ImageButton) findViewById(R.id.match_card_view_chat_button);

    rejectButton.setOnClickListener(rejectClickListener);
    acceptButton.setOnClickListener(acceptClickListener);
    chatButton.setOnClickListener(chatClickListener);
}
 
Example 5
Project: Show_Chat   File: TVFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View layout = inflater.inflate(R.layout.chat_fragment_group, container, false);

    listGroup = GroupDB.getInstance(getContext()).getListGroups();
    recyclerListGroups = (RecyclerView) layout.findViewById(R.id.recycleListGroup);
    mSwipeRefreshLayout = (SwipeRefreshLayout) layout.findViewById(R.id.swipeRefreshLayout);
    mSwipeRefreshLayout.setOnRefreshListener(this);
    GridLayoutManager layoutManager = new GridLayoutManager(getContext(), 2);
    recyclerListGroups.setLayoutManager(layoutManager);
    adapter = new ListMovieAdapter(getContext(), listGroup);
    recyclerListGroups.setAdapter(adapter);


    if(listGroup.size() == 0){
        //Ket noi server hien thi group
        mSwipeRefreshLayout.setRefreshing(true);
        getListGroup();
    }
    return layout;
}
 
Example 6
Project: GyroCheck-Android-Library   File: GyroView.java   View source code 6 votes vote down vote up
public GyroView(Context context) {
    super(context);
    this.context = context;

    setFitsSystemWindows(true);

    View v = LayoutInflater.from(getContext()).inflate(R.layout.text, this, false);
    addView(v);

    sensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE);
    sensor = sensorManager.getDefaultSensor(Sensor.TYPE_GYROSCOPE);
    textX = (TextView) findViewById(R.id.TextX);
    textY = (TextView) findViewById(R.id.TextY);
    textZ = (TextView) findViewById(R.id.TextZ);
    sensorManager.registerListener(this, sensor, SensorManager.SENSOR_DELAY_NORMAL);

}
 
Example 7
Project: boohee_v5.6   File: AlertDialogBuilder.java   View source code 6 votes vote down vote up
public AlertDialogBuilder builder() {
    View view = LayoutInflater.from(this.context).inflate(R.layout.o5, null);
    this.txt_title = (TextView) view.findViewById(R.id.txt_title);
    this.txt_title.setVisibility(8);
    this.txt_msg = (TextView) view.findViewById(R.id.txt_msg);
    this.txt_msg.setVisibility(8);
    this.btn_neg = (Button) view.findViewById(R.id.btn_neg);
    this.btn_neg.setVisibility(8);
    this.btn_pos = (Button) view.findViewById(R.id.btn_pos);
    this.btn_pos.setVisibility(8);
    this.img_line = (ImageView) view.findViewById(R.id.img_line);
    this.img_line.setVisibility(8);
    this.dialog = new Dialog(this.context, R.style.d);
    this.dialog.setContentView(view);
    return this;
}
 
Example 8
Project: OSchina_resources_android   File: TeamIssueDetailFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    View root = inflater.inflate(R.layout.fragment_team_issue_detail,
            container, false);
    Intent args = getActivity().getIntent();
    if (args != null) {
        mTeam = (Team) args.getSerializableExtra("team");
        mTeamIssue = (TeamIssue) args.getSerializableExtra("issue");
        mCatalog = (TeamIssueCatalog) args
                .getSerializableExtra("issue_catalog");
    }
    if (mCatalog != null) {

        ((BaseActivity) getActivity()).setActionBarTitle(mCatalog
                .getTitle());
    }
    initView(root);
    initData();
    return root;
}
 
Example 9
Project: Navalny.Pulse   File: ProfileFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
						 Bundle savedInstanceState)
{
	View view = inflater.inflate(R.layout.fragment_profile, container, false);
	unbinder = ButterKnife.bind(this, view);

	exitButton.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			SharedPreferenceHelper.setToken("");

			Intent intent = new Intent(getContext(), RegisterActivity.class);
			intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
			startActivity(intent);
		}
	});

	onViewClicked();

	return view;
}
 
Example 10
Project: TaipeiTechRefined   File: CreditGeneralView.java   View source code 6 votes vote down vote up
private void init() {
    container = new LinearLayout(getContext());
    container.setOrientation(LinearLayout.VERTICAL);
    container.setBackgroundResource(R.color.silver);
    for (GeneralCredit general : studentCredit.getGeneralCredits()) {
        LayoutInflater inflater = LayoutInflater.from(getContext());
        TextView title_text = (TextView) inflater.inflate(
                R.layout.credit_textview, this, false);
        title_text.setBackgroundResource(R.color.cloud);
        title_text.setTypeface(title_text.getTypeface(), Typeface.BOLD);
        title_text.setText(general.getTypeName());
        container.addView(title_text);
        TextView text = (TextView) inflater.inflate(
                R.layout.credit_textview, this, false);
        text.setBackgroundResource(R.color.white);
        String credit_text = getContext().getString(R.string.credit_essential_core) + general.getMustCoreCredit()
                + "  "+getContext().getString(R.string.credit_general_core) + general.getHadCoreCredit() + "  " + getContext().getString(R.string.credit_general_elective)
                + general.getHadCommonCredit();
        text.setText(credit_text);
        container.addView(text);
        addData(general);
    }
    addView(container);
}
 
Example 11
Project: Unofficial-Ups   File: AbsencesFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    //Init view model
    mViewModel = new AbsencesViewModel();
    // Inflate the layout for this fragment
    View v =  inflater.inflate(R.layout.fragment_attendance, container, false);
    ButterKnife.bind(this,v);

    rviAbsences.setLayoutManager(new LinearLayoutManager(getContext()));
    progressBar.setVisibility(View.VISIBLE);

    if(mAdapter==null){
        mAdapter = new AbsencesAdapter(getContext());
        mSubscription.add(mViewModel.getAttendanceStream()
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(this::addAbsence,this::displayError));
    }else{
        progressBar.setVisibility(View.GONE);
    }

    rviAbsences.setAdapter(mAdapter);

    return v;
}
 
Example 12
Project: V2I-Traffic-Light-Demonstrator   File: StatusPedestrianTab.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    // Inflate the layout for this fragment
    view = inflater.inflate(R.layout.status_pedestrian_tab_view, container, false);

    trafficLightImageView = (ImageView) view.findViewById(R.id.tab1_trafficLight_ImageView);
    trafficLightImageView.setImageResource(R.drawable.red_light);

    // Create the Handler object (on the main thread by default)
    handler = new Handler();

    appData = AppData.getInstance();

    startPeriodicRequestFromRestService();

    return view;
}
 
Example 13
Project: ZhihuUserProfile   File: UserInfoFragment.java   View source code 6 votes vote down vote up
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    switch (viewType) {
        case InfoItem.TYPE_SIMPLE_INFO:
            return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_simpe_info, parent, false));
        case InfoItem.TYPE_CUSTOM_TITLE:
            return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_custom_title, parent, false));
        case InfoItem.TYPE_DETAIL_INFO:
            return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_detail_info, parent, false));
        case InfoItem.TYPE_PERSONAL_ACHIEVEMENT:
            return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_personal_achievement, parent, false));
        case InfoItem.TYPE_SIMPLE_ITEM:
            return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_simple_item, parent, false));
        case InfoItem.TYPE_QUESTION:
            return new ViewHolder(LayoutInflater.from(mContext).inflate(R.layout.item_question, parent, false));
    }
    return null;
}
 
Example 14
Project: moebooru-android   File: PostFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_post_view, container, false);
    mRecyclerView = (RecyclerView) rootView.findViewById(R.id.rv_post);
    mLayoutManager = new StaggeredGridLayoutManager(SPAN_COUNT, StaggeredGridLayoutManager.VERTICAL);
    mRecyclerView.setLayoutManager(mLayoutManager);
    mSwipeRefreshLayout = rootView.findViewById(R.id.scroll_view);
    mSwipeRefreshLayout.setColorSchemeResources(
            android.R.color.holo_blue_bright,
            android.R.color.holo_green_light,
            android.R.color.holo_orange_light,
            android.R.color.holo_red_light);
    mAdapter = new PostViewAdapter(mListener, "post");
    mRecyclerView.setAdapter(mAdapter);
    return rootView;
}
 
Example 15
Project: CXJPadProject   File: SelectWorkerAndSalerFragment.java   View source code 6 votes vote down vote up
@Override  //Outsourcing
protected View initRootView(LayoutInflater inflater) {
    if (view == null) {
        view = View.inflate(getActivity(), R.layout.fragment_select_worker_and_saler, null);
    }
    ButterKnife.bind(this, view);
    ViewGroup myparent = (ViewGroup) view.getParent();
    //获取args传递的参数
    if (getArguments() != null) {
        sap = (OrderServiceAndPkgListModel) getArguments().getSerializable("sap");
        orderServiceListModel = (OrderServiceListModel) getArguments().getSerializable("orderServiceListModel");
    }
    if (myparent != null) {
        myparent.removeView(view);
    }
    return view;
}
 
Example 16
Project: GoogleVR   File: BaseQuickAdapter.java   View source code 6 votes vote down vote up
@Override
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    BaseViewHolder baseViewHolder = null;
    this.mContext = parent.getContext();
    this.mLayoutInflater = LayoutInflater.from(mContext);
    switch (viewType) {
        case LOADING_VIEW:
            baseViewHolder = getLoadingView(parent);
            break;
        case HEADER_VIEW:
            baseViewHolder = new BaseViewHolder(mHeaderView);
            break;
        case EMPTY_VIEW:
            baseViewHolder = new BaseViewHolder(mEmptyView);
            break;
        case FOOTER_VIEW:
            baseViewHolder = new BaseViewHolder(mFooterView);
            break;
        default:
            baseViewHolder = onCreateDefViewHolder(parent, viewType);
            initItemClickListener(baseViewHolder);
    }
    return baseViewHolder;

}
 
Example 17
Project: Mybilibili   File: MySearchView.java   View source code 6 votes vote down vote up
/**
 * 绑定搜索框xml视图
 */
private void initView() {
    // 1. 绑定R.layout.search_layout作为搜索框的xml文件
    LayoutInflater.from(mContext).inflate(R.layout.search_layout,this);
    et_search = (EditText) findViewById(R.id.et_search);
    et_search.setTextSize(textSizeSearch);
    et_search.setTextColor(textColorSearch);
    et_search.setHint(textHintSearch);

    // 3. 搜索框背景颜色
    search_block = (LinearLayout) findViewById(R.id.search_linear);
    LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) search_block.getLayoutParams();
    params.height = searchBlockHeight;
    search_block.setBackgroundColor(searchBlockColor);
    search_block.setLayoutParams(params);

    // 4. 历史搜索记录 = ListView显示
    listView = (SearchListView) findViewById(R.id.listView);

    // 5. 删除历史搜索记录 按钮
    tv_clear = (TextView) findViewById(R.id.tv_clear);
    tv_clear.setVisibility(INVISIBLE);

    // 6. 返回按键
    searchBack = (ImageView) findViewById(R.id.search_icon);
}
 
Example 18
Project: Instincts-2k17   File: AboutActivity.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View rootView;
    switch (getArguments().getInt(ARG_SECTION_NUMBER)) {
        case 0:
            rootView = inflater.inflate(R.layout.fragment_our_team, container, false);
            break;
        case 1:
            rootView = inflater.inflate(R.layout.fragment_about_instincts, container, false);
            break;
        case 2:
            rootView = inflater.inflate(R.layout.fragment_committees, container, false);
            break;
        case 3:
            rootView = inflater.inflate(R.layout.fragment_about_ssn, container, false);
            break;

        default:
            rootView = inflater.inflate(R.layout.fragment_about_instincts, container, false);
    }
    return rootView;
}
 
Example 19
Project: garras   File: BoardContributorsDialog.java   View source code 6 votes vote down vote up
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    @SuppressLint("InflateParams") View view = LayoutInflater.from(getActivity()).inflate(R.layout.dialog_board_contributors, null, false);
    unbinder = ButterKnife.bind(this, view);
    if (null == getActivity()) {
        return new AlertDialog.Builder(getActivity())
                .setTitle(R.string.contributors)
                .setView(view)
                .setNegativeButton(R.string.closed, null)
                .create();
    } else {
        return new android.support.v7.app.AlertDialog.Builder(getActivity())
                .setTitle(R.string.contributors)
                .setView(view)
                .setNegativeButton(R.string.closed, null)
                .create();
    }
}
 
Example 20
Project: IslamicLibraryAndroid   File: BookmarkFragment.java   View source code 6 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
                         Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.fragment_bookmark_list, container, false);

    // Set the adapter
    RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
    ViewStub zeroView = view.findViewById(R.id.zero_bookmarks);

    UserDataDBHelper userDataDBHelper = UserDataDBHelper.getInstance(getContext(), bookId);
    ArrayList<Bookmark> bookmarks = userDataDBHelper.getAllBookmarks(UserDataDBContract.BookmarkEntry.COLUMN_NAME_PAGE_ID);

    if (bookmarks.size() != 0) {
        recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
        recyclerView.addItemDecoration(new DividerItemDecoration(getContext(), DividerItemDecoration.VERTICAL));
        bookmarkRecyclerViewAdapter = new BookmarkRecyclerViewAdapter(bookmarks, mListener, getContext(), userDataDBHelper, getActivity().getPreferences(Context.MODE_PRIVATE));
        bookmarkRecyclerViewAdapter.setHasStableIds(true);
        recyclerView.setAdapter(bookmarkRecyclerViewAdapter);
    } else {
        recyclerView.setVisibility(View.GONE);
        zeroView.setVisibility(View.VISIBLE);
    }

    return view;
}
 
Example 21
Project: simple-stack   File: HomeController.java   View source code 5 votes vote down vote up
@NonNull
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container) {
    View view = inflater.inflate(R.layout.home_view, container, false);
    ButterKnife.bind(this, view);
    HomeKey homeKey = getKey();
    return view;
}
 
Example 22
Project: godlibrary   File: DialogListView.java   View source code 5 votes vote down vote up
public AlertDialog show(Context context) {
    LayoutInflater inflater = LayoutInflater.from(context);
    View v = inflater.inflate(R.layout.dialog_listview_select, null);
    listView = (ListView) v.findViewById(R.id.listView);
    submit = (Button) v.findViewById(R.id.but_submit);
    dialog = new AlertDialog.Builder(context).setView(v).create();
    dialog.show();
    Window window = dialog.getWindow();
    window.setGravity(Gravity.CENTER);
    window.setBackgroundDrawableResource(R.color.transparent);

    return dialog;
}
 
Example 23
Project: mapbook-android   File: MapLegendAdapter.java   View source code 5 votes vote down vote up
/**
 *This method calls onCreateViewHolder(ViewGroup, int) to create a new RecyclerView.ViewHolder
 * and initializes some private fields to be used by RecyclerView.
 * @param parent - ViewGroup
 * @param viewType - int
 * @return MapLayerViewHolder
 */
@Override public MapLegendViewHodler onCreateViewHolder(final ViewGroup parent, final int viewType) {
  final View itemView = LayoutInflater.
      from(parent.getContext()).
      inflate(R.layout.legend_view, parent, false);

  return new MapLegendViewHodler(itemView);
}
 
Example 24
Project: TimeTrix   File: CustomAdapterTags.java   View source code 5 votes vote down vote up
@Override
public View getGroupView(final int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
    LayoutInflater inflater = (LayoutInflater) mContext.getSystemService (Context.LAYOUT_INFLATER_SERVICE);
    View view;
    view = inflater.inflate (R.layout.custom_row_tags, parent, false);
    NoteUtil noteUtil = new NoteUtil (mContext);
    JSONArray tagList = noteUtil.getDistinctTags (mSectionID);
    TextView textView = (TextView) view.findViewById (R.id.textViewTagRow);
    try {
        textView.setText (tagList.getJSONObject (groupPosition).getString (GlobalData.NOTE_TAG_NAME));
        String tagColor = tagList.getJSONObject (groupPosition).getString (GlobalData.NOTE_TAG_COLOR);
        switch (tagColor) {
            case "Yellow":
                textView.setTextColor (Color.YELLOW);
                break;
            case "Red":
                textView.setTextColor (Color.RED);
                break;
            case "Green":
                textView.setTextColor (Color.GREEN);
                break;
        }
    } catch (JSONException e) {
        e.printStackTrace ();
    }
    return view;
}
 
Example 25
Project: GitHub   File: LazyFragment.java   View source code 5 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    this.layoutInflater = inflater;
    this.container = container;
    onCreateView(savedInstanceState);
    if (rootView == null)
        return super.onCreateView(inflater, container, savedInstanceState);

    return rootView;
}
 
Example 26
Project: leoapp-sources   File: UserFragment.java   View source code 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (view == null) {
        view = inflater.inflate(R.layout.fragment_recyclerview, container, false);
        initRecyclerView();
    }
    return view;
}
 
Example 27
Project: Sprog-App   File: PoemActivity.java   View source code 5 votes vote down vote up
public void displayParentComment(CharSequence content, CharSequence author) {
    View v = LayoutInflater.from(this)
            .inflate(R.layout.parents_list_row, mainlist, false);
    ((TextView) v.findViewById(R.id.content))
            .setText(content);
    ((TextView) v.findViewById(R.id.content))
            .setMovementMethod(LinkMovementMethod.getInstance());
    ((TextView) v.findViewById(R.id.author)).setText(author);
    mainlist.addView(v);
}
 
Example 28
Project: PlusGram   File: lastChatAdapter.java   View source code 5 votes vote down vote up
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View itemView = LayoutInflater.from(parent.getContext())
            .inflate(R.layout.drawer_user_item, parent, false);

    return new MyViewHolder(itemView);
}
 
Example 29
Project: MyEyepetizer   File: MovieDetailAuthorBinder.java   View source code 5 votes vote down vote up
@NonNull
@Override
protected ViewHolder onCreateViewHolder(@NonNull LayoutInflater inflater, @NonNull ViewGroup parent) {
    View view = inflater.inflate(R.layout.item_movie_author, parent, false);

    return new ViewHolder(view);
}
 
Example 30
Project: boohee_v5.6   File: OrderListAdapter.java   View source code 5 votes vote down vote up
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder holder;
    if (convertView == null) {
        convertView = LayoutInflater.from(this.ctx).inflate(R.layout.np, null);
        holder = new ViewHolder();
        holder.orderNum = (TextView) convertView.findViewById(R.id.order_num_value);
        holder.createdTime = (TextView) convertView.findViewById(R.id.created_at_value);
        holder.title = (TextView) convertView.findViewById(R.id.title);
        holder.image_list_layout = (LinearLayout) convertView.findViewById(R.id.image_list);
        holder.price = (TextView) convertView.findViewById(R.id.price_all_value);
        holder.payBtn = (Button) convertView.findViewById(R.id.pay_btn);
        holder.orderState = (TextView) convertView.findViewById(R.id.order_state_value);
        holder.cancelOrder = (TextView) convertView.findViewById(R.id.cancel_order);
        holder.tv_description = (TextView) convertView.findViewById(R.id.tv_description);
        holder.tv_carriage = (TextView) convertView.findViewById(R.id.tv_carriage);
        holder.bottom_bar = convertView.findViewById(R.id.bottom_bar);
        holder.bottom_submit = convertView.findViewById(R.id.bottom_submit);
        holder.bt_submit = (Button) convertView.findViewById(R.id.bt_submit);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
    if (((Order) this.orders.get(position)).type.equals("GoodsOrder")) {
        setUchoiceOderView((UchoiceOrder) this.orders.get(position), holder, convertView,
                position);
    } else if (((Order) this.orders.get(position)).type.equals("RecipeOrder")) {
        setRecipeOrderView((RecipeOrder) getItem(position), holder);
    } else if (((Order) this.orders.get(position)).type.equals("NiceOrder")) {
        setRecipeOrderView((NiceOrder) getItem(position), holder);
    }
    return convertView;
}
 
Example 31
Project: PictureShow   File: ConfirmDialog.java   View source code 5 votes vote down vote up
private ConfirmDialog(Context ctx) {
    mContext = ctx;
    internalDialogBuilder = new AlertDialog.Builder(mContext, R.style.ConfirmDialogStyle);
    layoutInflater = (LayoutInflater)ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
 
Example 32
Project: Linphone4Android   File: RemoteProvisioningFragment.java   View source code 5 votes vote down vote up
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
		Bundle savedInstanceState) {
	View view = inflater.inflate(R.layout.assistant_remote_provisioning, container, false);
	
	remoteProvisioningUrl = (EditText) view.findViewById(R.id.assistant_remote_provisioning_url);
	remoteProvisioningUrl.addTextChangedListener(this);
	apply = (Button) view.findViewById(R.id.assistant_apply);
	apply.setEnabled(false);
	apply.setOnClickListener(this);
	
	return view;
}
 
Example 33
Project: android_ui   File: RefreshGridFragment.java   View source code 5 votes vote down vote up
@Override
@SuppressWarnings("ConstantConditions")
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
	final ViewGroup view = (ViewGroup) super.onCreateView(inflater, container, savedInstanceState);
	view.removeView(view.findViewById(android.R.id.list));
	view.addView(mGridView = (GridViewWidget) inflater.inflate(R.layout.grid_view_swipe_to_refresh, container, false));
	return view;
}
 
Example 34
Project: Blockly   File: ItemAdapter.java   View source code 5 votes vote down vote up
@Override
public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {


    MyViewHolder holder = new MyViewHolder(LayoutInflater.from(
            context).inflate(com.google.blockly.android.R.layout.item_layout, parent,
            false));
    return holder;
}
 
Example 35
Project: GlossikaSchedule   File: NewScheduleLanguageFragment.java   View source code 5 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
	// get activity
	activity = ((NewScheduleActivity) getActivity());
	// update action bar
	ActionBar actionBar = activity.getSupportActionBar();
	actionBar.setTitle("Which language are you studying?");
	actionBar.setDisplayHomeAsUpEnabled(false);

	// load view
	View view = inflater.inflate(R.layout.fragment_new_schedule_language, container, false);

	RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
	LanguageSelectAdapter languageSelectAdapter = new LanguageSelectAdapter(LanguageData.languages, selectedLanguage);
	languageSelectAdapter.asObservable().subscribe(language -> {
		activity.updateLanguage(language);
		selectedLanguage = language;
		NewScheduleScheduleFragment fragment = new NewScheduleScheduleFragment();
		getFragmentManager().beginTransaction()
				.replace(R.id.fragmentContainer, fragment)
				.addToBackStack(null)
				.commit();
	});
	recyclerView.setAdapter(languageSelectAdapter);
	recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
	return view;
}
 
Example 36
Project: thesis-project   File: Home_Schedule_Slidebar_Fragment.java   View source code 5 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
                         @Nullable Bundle savedInstanceState) {
    customView = inflater.inflate(R.layout.home_fragment_slidebar_schedule, container, false);
    handler = new Handler(getActivity().getMainLooper());
    init();
    return customView;
}
 
Example 37
Project: chromium-for-android-56-debug-video   File: AppMenuAdapter.java   View source code 5 votes vote down vote up
public AppMenuAdapter(AppMenu appMenu, List<MenuItem> menuItems, LayoutInflater inflater) {
    mAppMenu = appMenu;
    mMenuItems = menuItems;
    mInflater = inflater;
    mNumMenuItems = menuItems.size();
    mDpToPx = inflater.getContext().getResources().getDisplayMetrics().density;
}
 
Example 38
Project: KomaMusic   File: PlaylistAdapter.java   View source code 5 votes vote down vote up
@Override
public BaseViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view;
    if (viewType == TYPE_HEADER) {
        view = LayoutInflater.from(mContext).inflate(R.layout.item_playlist_header, parent, false);
        return new PlaylistHeaderVH(view);
    } else {
        view = LayoutInflater.from(mContext).inflate(R.layout.item_song_info_base, parent, false);
        return new PlaylistViewHolder(view);
    }
}
 
Example 39
Project: Orin   File: AlbumAdapter.java   View source code 5 votes vote down vote up
@NonNull
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view;
    if (activity instanceof MainActivity && viewType == TOP_ALBUM_ITEM) {
        view = LayoutInflater.from(activity).inflate(R.layout.item_grid_full_width, parent, false);
    } else {
        view = LayoutInflater.from(activity).inflate(itemLayoutRes, parent, false);
    }
    return createViewHolder(view, viewType);
}
 
Example 40
Project: Ghost-Android   File: BaseFragment.java   View source code 5 votes vote down vote up
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    super.onCreateView(inflater, container, savedInstanceState);
    Log.i(Log.Tag.LIFECYCLE, "%s#onCreateView()", mClassName);
    return null;
}