Search in sources :

Example 51 with RecyclerView

use of android.support.v7.widget.RecyclerView in project qksms by moezbhatti.

the class QKDialog method onCreateDialog.

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = new Dialog(mContext);
    Window window = dialog.getWindow();
    window.requestFeature(Window.FEATURE_NO_TITLE);
    window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    window.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    LayoutInflater inflater = getActivity().getLayoutInflater();
    View view = inflater.inflate(R.layout.dialog_material, null);
    if (mTitleEnabled || mMessageEnabled) {
        mContentPanel = (LinearLayout) view.findViewById(R.id.contentPanel);
        mContentPanel.setVisibility(View.VISIBLE);
    }
    if (mTitleEnabled) {
        mTitleView = (QKTextView) view.findViewById(R.id.alertTitle);
        mTitleView.setVisibility(View.VISIBLE);
        mTitleView.setText(mTitleText);
        Log.d(TAG, "title enabled");
    }
    if (mMessageEnabled) {
        mMessageView = (QKTextView) view.findViewById(R.id.message);
        mMessageView.setVisibility(View.VISIBLE);
        mMessageView.setText(mMessageText);
    }
    if (mCustomViewEnabled) {
        mCustomPanel = (LinearLayout) view.findViewById(R.id.customPanel);
        mCustomPanel.setVisibility(View.VISIBLE);
        if (mCustomView instanceof ListView || mCustomView instanceof RecyclerView) {
            mCustomPanel.addView(mCustomView);
        } else {
            ScrollView scrollView = new ScrollView(mContext);
            scrollView.addView(mCustomView);
            mCustomPanel.addView(scrollView);
        }
    }
    if (mPositiveButtonEnabled || mNegativeButtonEnabled) {
        mButtonBar = (LinearLayout) view.findViewById(R.id.buttonPanel);
        mButtonBar.setVisibility(View.VISIBLE);
        mButtonBar.setOrientation(mButtonBarOrientation);
    }
    if (mPositiveButtonEnabled) {
        mPositiveButtonView = (QKTextView) view.findViewById(R.id.buttonPositive);
        mPositiveButtonView.setVisibility(View.VISIBLE);
        mPositiveButtonView.setText(mPositiveButtonText);
        mPositiveButtonView.setOnClickListener(mPositiveButtonClickListener);
        LiveViewManager.registerView(QKPreference.THEME, mPositiveButtonView, key -> {
            mPositiveButtonView.setTextColor(ThemeManager.getColor());
        });
    }
    if (mNeutralButtonEnabled) {
        mNeutralButtonView = (QKTextView) view.findViewById(R.id.buttonNeutral);
        mNeutralButtonView.setVisibility(View.VISIBLE);
        mNeutralButtonView.setText(mNeutralButtonText);
        mNeutralButtonView.setOnClickListener(mNeutralButtonClickListener);
    }
    if (mNegativeButtonEnabled) {
        mNegativeButtonView = (QKTextView) view.findViewById(R.id.buttonNegative);
        mNegativeButtonView.setVisibility(View.VISIBLE);
        mNegativeButtonView.setText(mNegativeButtonText);
        mNegativeButtonView.setOnClickListener(mNegativeButtonClickListener);
    }
    dialog.setContentView(view);
    return dialog;
}
Also used : Window(android.view.Window) ListView(android.widget.ListView) ColorDrawable(android.graphics.drawable.ColorDrawable) ScrollView(android.widget.ScrollView) Dialog(android.app.Dialog) LayoutInflater(android.view.LayoutInflater) RecyclerView(android.support.v7.widget.RecyclerView) QKTextView(com.moez.QKSMS.ui.view.QKTextView) View(android.view.View) AdapterView(android.widget.AdapterView) RecyclerView(android.support.v7.widget.RecyclerView) ScrollView(android.widget.ScrollView) ListView(android.widget.ListView)

Example 52 with RecyclerView

use of android.support.v7.widget.RecyclerView in project Signal-Android by WhisperSystems.

the class StickerSelectFragment method onCreateView.

@Nullable
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
    View view = inflater.inflate(R.layout.scribble_select_sticker_fragment, container, false);
    this.recyclerView = (RecyclerView) view.findViewById(R.id.stickers_recycler_view);
    return view;
}
Also used : ImageView(android.widget.ImageView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View) Nullable(android.support.annotation.Nullable)

Example 53 with RecyclerView

use of android.support.v7.widget.RecyclerView in project chuck by jgilfelt.

the class DividerItemDecoration method drawVertical.

private void drawVertical(Canvas c, RecyclerView parent) {
    final int left = parent.getPaddingLeft();
    final int right = parent.getWidth() - parent.getPaddingRight();
    final int childCount = parent.getChildCount() - (mIncludeLastItem ? 0 : 1);
    for (int i = 0; i < childCount; i++) {
        final View child = parent.getChildAt(i);
        final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams) child.getLayoutParams();
        final int top = child.getBottom() + params.bottomMargin + Math.round(ViewCompat.getTranslationY(child));
        final int bottom = top + mDivider.getIntrinsicHeight();
        mDivider.setBounds(left, top, right, bottom);
        mDivider.draw(c);
    }
}
Also used : RecyclerView(android.support.v7.widget.RecyclerView) RecyclerView(android.support.v7.widget.RecyclerView) View(android.view.View)

Example 54 with RecyclerView

use of android.support.v7.widget.RecyclerView in project Android-ObservableScrollView by ksoichiro.

the class RecyclerViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_recyclerview);
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) findViewById(R.id.scrollable);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setScrollViewCallbacks(this);
    UiTestUtils.setDummyData(this, recyclerView);
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Example 55 with RecyclerView

use of android.support.v7.widget.RecyclerView in project Android-ObservableScrollView by ksoichiro.

the class TouchInterceptionRecyclerViewActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_touchinterception_recyclerview);
    ((TextView) findViewById(R.id.title)).setText(getClass().getSimpleName());
    mScrollable = (Scrollable) findViewById(R.id.scrollable);
    mScrollable.setScrollViewCallbacks(this);
    ObservableRecyclerView recyclerView = (ObservableRecyclerView) mScrollable;
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setHasFixedSize(true);
    recyclerView.setScrollViewCallbacks(this);
    UiTestUtils.setDummyData(this, recyclerView);
    mIntersectionHeight = getResources().getDimensionPixelSize(R.dimen.intersection_height);
    mHeaderBarHeight = getResources().getDimensionPixelSize(R.dimen.header_bar_height);
    mInterceptionLayout = (TouchInterceptionFrameLayout) findViewById(R.id.scroll_wrapper);
    mInterceptionLayout.setScrollInterceptionListener(mInterceptionListener);
}
Also used : ObservableRecyclerView(com.github.ksoichiro.android.observablescrollview.ObservableRecyclerView) TextView(android.widget.TextView) LinearLayoutManager(android.support.v7.widget.LinearLayoutManager)

Aggregations

RecyclerView (android.support.v7.widget.RecyclerView)1778 View (android.view.View)1237 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1106 TextView (android.widget.TextView)384 GridLayoutManager (android.support.v7.widget.GridLayoutManager)234 DefaultItemAnimator (android.support.v7.widget.DefaultItemAnimator)225 ImageView (android.widget.ImageView)210 ArrayList (java.util.ArrayList)190 Toolbar (android.support.v7.widget.Toolbar)137 Intent (android.content.Intent)117 DividerItemDecoration (android.support.v7.widget.DividerItemDecoration)102 ViewGroup (android.view.ViewGroup)101 Nullable (android.support.annotation.Nullable)99 Context (android.content.Context)96 StaggeredGridLayoutManager (android.support.v7.widget.StaggeredGridLayoutManager)96 SwipeRefreshLayout (android.support.v4.widget.SwipeRefreshLayout)93 ItemTouchHelper (android.support.v7.widget.helper.ItemTouchHelper)93 Bundle (android.os.Bundle)92 Test (org.junit.Test)90 Paint (android.graphics.Paint)80