@Nullable @Override public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { View contentView = inflater.inflate(R.layout.fragment_tab_list, null); mContentLv = (ListView) contentView.findViewById(R.id.lv_content); mContentLv.setOnItemClickListener(this); ViewCompat.setNestedScrollingEnabled(mContentLv, true); mContentLv.setAdapter(new ContentAdapter()); return contentView; }
private void initView(Context context) { View view = inflate(context, R.layout.view_demo_list,this); listview = (ListView) view.findViewById(R.id.listview); ArrayAdapter<String> adapter = new ArrayAdapter<>( context, android.R.layout.simple_expandable_list_item_1, getData()); listview.setAdapter(adapter); ViewCompat.setNestedScrollingEnabled(listview, true); }
public TLRNestedLinearLayout(Context context, AttributeSet attrs, int defStyleAttr) { super(context, attrs, defStyleAttr); mCalculator = calculator(); mParentHelper = new NestedScrollingParentHelper(this); ViewCompat.setNestedScrollingEnabled(this, true); }
@AfterViews protected void onInit( ) { mAppNameText.setTextColor(ColorUtil.getColorFromTheme(getActivity().getTheme(), R.attr.colorAccent)); mAppNameText.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { DownloadUtil.launchBrowser(getContext(), Constants.GitHubURL); } }); try { WebView v = getWebView(); ViewCompat.setNestedScrollingEnabled(v, true); mTextContainer.addView(v); } catch (Exception e) { try { TextView v = getTextView(); ViewCompat.setNestedScrollingEnabled(v, true); mTextContainer.addView(v); } catch (Exception ignored) { } } }
@Override protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); } setContentView(R.layout.activity_palette_detail); mToolbarCtl = (CollapsingToolbarLayout) findViewById(R.id.ctl_toolbar); mHeaderIv = (ImageView) findViewById(R.id.iv_header); mContentSv = (ScrollView) findViewById(R.id.sv_content); ViewCompat.setNestedScrollingEnabled(mContentSv, true); int index = getIntent().getIntExtra(EXTRA_INDEX, 0); mHeaderIv.setImageResource(getResources().getIdentifier("ic_palette_0"+index%4, "mipmap", getPackageName())); palette(getResources().getIdentifier("ic_palette_0"+index%4, "mipmap", getPackageName())); }
public void upadateActionItems(AbsListView currentView) { mActionMenu.attachToListView(currentView); int defaultColor = SettingsActivity.getPrimaryColor(this); ViewCompat.setNestedScrollingEnabled(currentView, true); mActionMenu.show(); mActionMenu.setVisibility(!isTelevision() && showActionMenu() ? View.VISIBLE : View.GONE); mActionMenu.setBackgroundTintList(SettingsActivity.getAccentColor()); mActionMenu.setSecondaryBackgroundTintList(Utils.getActionButtonColor(defaultColor)); }