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;
}
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;
}
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);
}
}
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);
}
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);
}
Aggregations