本文整理匯總了Java中com.scwang.refreshlayout.R類的典型用法代碼示例。如果您正苦於以下問題:Java R類的具體用法?Java R怎麽用?Java R使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
R類屬於com.scwang.refreshlayout包,在下文中一共展示了R類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_practice_feedlist);
final Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
final RefreshLayout refreshLayout = (RefreshLayout) findViewById(R.id.refreshLayout);
if (isFirstEnter) {
isFirstEnter = false;
refreshLayout.autoRefresh();
}
}
示例2: onCreate
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_practice_profile);
final Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
//狀態欄透明和間距處理
StatusBarUtil.immersive(this);
StatusBarUtil.setPaddingSmart(this, toolbar);
StatusBarUtil.setPaddingSmart(this, findViewById(R.id.profile));
StatusBarUtil.setPaddingSmart(this, findViewById(R.id.blurview));
}
示例3: onItemClick
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (Item.values()[position]) {
case 默認主題:
mRefreshLayout.setPrimaryColorsId(android.R.color.white, android.R.color.black);
break;
case 藍色主題:
setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark);
break;
case 綠色主題:
setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark);
break;
case 紅色主題:
setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark);
break;
case 橙色主題:
setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark);
break;
}
mRefreshLayout.autoRefresh();
}
示例4: updateTheme
import com.scwang.refreshlayout.R; //導入依賴的package包/類
private void updateTheme() {
if (mThemeListener == null) {
mThemeListener = new View.OnClickListener() {
int index = 0;
int[] ids = new int[]{
R.color.colorPrimary,
android.R.color.holo_green_light,
android.R.color.holo_red_light,
android.R.color.holo_orange_light,
android.R.color.holo_blue_bright,
};
@Override
public void onClick(View v) {
int color = ContextCompat.getColor(getApplication(), ids[index % ids.length]);
mRefreshlayout.setPrimaryColors(color);
mActionButton.setBackgroundColor(color);
mActionButton.setBackgroundTintList(ColorStateList.valueOf(color));
mToolbarLayout.setContentScrimColor(color);
index++;
}
};
}
mThemeListener.onClick(null);
}
示例5: preAnimateAddImpl
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
protected void preAnimateAddImpl(RecyclerView.ViewHolder holder) {
View icon = holder.itemView.findViewById(R.id.icon);
icon.setRotationX(30);
View right = holder.itemView.findViewById(R.id.right);
right.setPivotX(0);
right.setPivotY(0);
right.setRotationY(90);
}
示例6: onItemClick
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (Item.values()[position]) {
case 內容不偏移:
mRefreshLayout.setEnableHeaderTranslationContent(false);
break;
case 內容跟隨偏移:
mRefreshLayout.setEnableHeaderTranslationContent(true);
break;
case 藍色主題:
setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark);
break;
case 綠色主題:
setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark);
break;
case 紅色主題:
setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark);
break;
case 橙色主題:
setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark);
break;
}
mRefreshLayout.autoRefresh();
}
示例7: onItemClick
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (Item.values()[position]) {
case 藍色主題:
setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark);
break;
case 綠色主題:
setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark);
break;
case 紅色主題:
setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark);
break;
case 橙色主題:
setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark);
break;
}
mRefreshLayout.autoRefresh();
}
示例8: onItemClick
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
switch (Item.values()[position]) {
case 默認主題:
setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark);
mRefreshLayout.setPrimaryColors(0xff283645, 0xff6ea9ff);
break;
case 藍色主題:
setThemeColor(R.color.colorPrimary, R.color.colorPrimaryDark);
break;
case 綠色主題:
setThemeColor(android.R.color.holo_green_light, android.R.color.holo_green_dark);
break;
case 紅色主題:
setThemeColor(android.R.color.holo_red_light, android.R.color.holo_red_dark);
break;
case 橙色主題:
setThemeColor(android.R.color.holo_orange_light, android.R.color.holo_orange_dark);
break;
}
mRefreshLayout.autoRefresh();
}
示例9: onCreate
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_experiment);
final RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
recyclerView.addItemDecoration(new DividerItemDecoration(this, VERTICAL));
recyclerView.setLayoutManager(new LinearLayoutManager(this));
recyclerView.setAdapter(new BaseRecyclerAdapter<Void>(buildData(),simple_list_item_2) {
@Override
protected void onBindViewHolder(SmartViewHolder holder, Void model, int position) {
holder.text(android.R.id.text1, String.format(Locale.CHINA, "第%02d條數據", position));
holder.text(android.R.id.text2, String.format(Locale.CHINA, "這是測試的第%02d條數據", position));
holder.textColorId(android.R.id.text2, R.color.colorTextAssistant);
}
});
}
示例10: onRefresh
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
public void onRefresh(RefreshLayout refreshlayout) {
mRefreshLayout.getLayout().postDelayed(new Runnable() {
@Override
public void run() {
mRecyclerView.setAdapter(new BaseRecyclerAdapter<Item>(Arrays.asList(Item.values()), simple_list_item_2,EmptyLayoutUsingFragmentInner.this) {
@Override
protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) {
holder.text(android.R.id.text1, model.name());
holder.text(android.R.id.text2, model.name);
holder.textColorId(android.R.id.text2, R.color.colorTextAssistant);
}
});
mRefreshLayout.finishRefresh();
mEmptyLayout.setVisibility(View.GONE);
}
}, 2000);
}
示例11: onRefresh
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
public void onRefresh(RefreshLayout refreshlayout) {
mRefreshLayout.getLayout().postDelayed(new Runnable() {
@Override
public void run() {
mRecyclerView.setAdapter(new BaseRecyclerAdapter<Item>(Arrays.asList(Item.values()), simple_list_item_2, EmptyLayoutUsingFragmentOuter.this) {
@Override
protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) {
holder.text(android.R.id.text1, model.name());
holder.text(android.R.id.text2, model.name);
holder.textColorId(android.R.id.text2, R.color.colorTextAssistant);
}
});
mRefreshLayout.finishRefresh();
mEmptyLayout.setVisibility(View.GONE);
}
}, refreshlayout != null ? 2000 : 0);
}
示例12: onViewCreated
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
public void onViewCreated(@NonNull View root, @Nullable Bundle savedInstanceState) {
super.onViewCreated(root, savedInstanceState);
final Toolbar toolbar = (Toolbar)root.findViewById(R.id.toolbar);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getActivity().finish();
}
});
mRefreshLayout = (RefreshLayout) root.findViewById(refreshLayout);
mRefreshLayout.setOnRefreshLoadmoreListener(this);
mRefreshLayout.setRefreshHeader(new ClassicsHeader(getContext()));
mRefreshLayout.setRefreshFooter(new ClassicsFooter(getContext()));
mViewPager = (ViewPager) root.findViewById(R.id.viewPager);
mTabLayout = (TabLayout) root.findViewById(R.id.tableLayout);
mViewPager.setAdapter(mAdapter = new SmartPagerAdapter(Item.values()));
mTabLayout.setupWithViewPager(mViewPager, true);
}
示例13: onRefresh
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
public void onRefresh(RefreshLayout refreshlayout) {
mRefreshLayout.getLayout().postDelayed(new Runnable() {
@Override
public void run() {
mRecyclerView.setAdapter(new BaseRecyclerAdapter<Item>(Arrays.asList(Item.values()), simple_list_item_2,EmptyLayoutUsingFragment.this) {
@Override
protected void onBindViewHolder(SmartViewHolder holder, Item model, int position) {
holder.text(android.R.id.text1, model.name());
holder.text(android.R.id.text2, model.name);
holder.textColorId(android.R.id.text2, R.color.colorTextAssistant);
}
});
mRefreshLayout.finishRefresh();
mLoadingLayout.showContent();
}
}, 2000);
}
示例14: animateAddImpl
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@Override
protected void animateAddImpl(final RecyclerView.ViewHolder holder) {
View target = holder.itemView;
View icon = target.findViewById(R.id.icon);
Animator swing = ObjectAnimator.ofFloat(icon, "rotationX", 45, 0);
swing.setInterpolator(new OvershootInterpolator(5));
View right = holder.itemView.findViewById(R.id.right);
Animator rotateIn = ObjectAnimator.ofFloat(right, "rotationY", 90, 0);
rotateIn.setInterpolator(new DecelerateInterpolator());
AnimatorSet animator = new AnimatorSet();
animator.setDuration(getAddDuration());
animator.playTogether(swing, rotateIn);
animator.start();
}
示例15: createRefreshHeader
import com.scwang.refreshlayout.R; //導入依賴的package包/類
@NonNull
@Override
public RefreshHeader createRefreshHeader(Context context, RefreshLayout layout) {
ClassicsHeader header = new ClassicsHeader(context).setSpinnerStyle(SpinnerStyle.FixedBehind);
header.setPrimaryColorId(R.color.colorPrimary);
header.setAccentColorId(android.R.color.white);
return header;//指定為經典Header,默認是 貝塞爾雷達Header
}