本文整理汇总了Java中android.support.v7.widget.CardView.setVisibility方法的典型用法代码示例。如果您正苦于以下问题:Java CardView.setVisibility方法的具体用法?Java CardView.setVisibility怎么用?Java CardView.setVisibility使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.widget.CardView
的用法示例。
在下文中一共展示了CardView.setVisibility方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Fabric.with(this, new Crashlytics());
setContentView(R.layout.activity_login_registration);
login = (Button) findViewById(R.id.btn_login);
register = (Button) findViewById(R.id.btn_register);
cardView=(CardView)findViewById(R.id.layout2);
splashActivity=new SplashActivity();
login.setOnClickListener(this);
register.setOnClickListener(this);
b=splashActivity.containsPass("password");
if(b==true)
{
register.setVisibility(View.INVISIBLE);
cardView.setVisibility(View.INVISIBLE);
}
}
示例2: animateOut
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void animateOut(final CardView view) {
if (animInProgress)
return;
animInProgress = true;
view.setVisibility(View.VISIBLE);
ViewCompat.animate(view).translationX(hiddenPosX)
.setInterpolator(interpolator).withLayer()
.setListener(new ViewPropertyAnimatorListenerAdapter() {
@Override
public void onAnimationEnd(View view1) {
super.onAnimationEnd(view1);
animInProgress = false;
if (currentPos > 400)
animateIn(view);
else animateOut(view);
}
})
.start();
}
示例3: animateIn
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void animateIn(final CardView view) {
if (animInProgress)
return;
animInProgress = true;
view.setVisibility(View.VISIBLE);
ViewCompat.animate(view).translationX(shownPosX)
.setInterpolator(interpolator).withLayer()
.setListener(new ViewPropertyAnimatorListenerAdapter() {
@Override
public void onAnimationEnd(View view1) {
super.onAnimationEnd(view1);
animInProgress = false;
if (currentPos > 400)
animateIn(view);
else animateOut(view);
}
})
.start();
}
示例4: setUpTimestamps
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void setUpTimestamps() {
CardView cardView = rootView.findViewById(R.id.aur_package_details_timestamps_card_view);
cardView.setVisibility(View.VISIBLE);
TextView lastUpdatedTextView = rootView.findViewById(R.id.aur_package_details_last_updated_text_view);
TextView firstSubmittedTextView = rootView.findViewById(R.id.aur_package_details_first_submitted_text_view);
TextView flaggedOutOfDateTextView = rootView.findViewById(R.id.aur_package_details_flagged_out_of_date_text_view);
TextView flaggedOutOfDateLabelTextView = rootView.findViewById(R.id.aur_package_details_flagged_out_of_date_label_text_view);
// last updated
lastUpdatedTextView.setText(String.format("%s", responseAurInfoResult.lastModified == null ?
resources.getString(R.string.not_available)
: aurDroidUtils.getConvertedUnixTimeString(responseAurInfoResult.lastModified)));
// first submitted
firstSubmittedTextView.setText(String.format("%s", responseAurInfoResult.firstSubmitted == null ?
resources.getString(R.string.not_available)
: aurDroidUtils.getConvertedUnixTimeString(responseAurInfoResult.firstSubmitted)));
// flagged out of date
if (responseAurInfoResult.outOfDate != null) {
flaggedOutOfDateLabelTextView.setVisibility(TextUtils.isEmpty(responseAurInfoResult.outOfDate) ?
View.GONE : View.VISIBLE);
flaggedOutOfDateTextView.setVisibility(TextUtils.isEmpty(responseAurInfoResult.outOfDate) ?
View.GONE : View.VISIBLE);
flaggedOutOfDateTextView.setText(String.format("%s", TextUtils.isEmpty(responseAurInfoResult.outOfDate) ?
responseAurInfoResult.outOfDate
: aurDroidUtils.getConvertedUnixTimeString(Integer.parseInt(responseAurInfoResult.outOfDate))));
}
}
示例5: initZoomRegionView
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
/**
* Init the ZoomRegionView for navigate into image when user zoom in
*/
private void initZoomRegionView() {
if (mZoomRegionView == null) {
Bitmap init = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888);
mContentBitmap = init.copy(Bitmap.Config.ARGB_8888, true);
init.recycle();
mContentCanvas = new Canvas(mContentBitmap);
FrameLayout.LayoutParams layoutParams = new LayoutParams(getWidth() / 4, getHeight() / 4,
Gravity.TOP | Gravity.END);
layoutParams.setMargins(12, 12, 12, 12);
mZoomRegionCardView = new CardView(getContext());
mZoomRegionCardView.setLayoutParams(layoutParams);
mZoomRegionCardView.setPreventCornerOverlap(true);
mZoomRegionCardView.setRadius(0f);
mZoomRegionCardView.setUseCompatPadding(true);
mZoomRegionCardView.setVisibility(View.INVISIBLE);
CardView.LayoutParams childLayoutParams = new LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT);
mZoomRegionView = new ZoomRegionView(getContext());
mZoomRegionView.setLayoutParams(childLayoutParams);
mZoomRegionView.setScaleType(ImageView.ScaleType.CENTER_CROP);
mZoomRegionView.setOnZoomRegionListener(new ZoomRegionView.OnZoomRegionListener() {
@Override
public void onZoomRegionMoved(Rect newRect) {
mFromZoomRegion = true;
mZoomCenterX = newRect.centerX() * 4;
mZoomCenterY = newRect.centerY() * 4;
invalidate();
}
});
mZoomRegionCardView.addView(mZoomRegionView);
addView(mZoomRegionCardView);
}
}
示例6: setupSwitches
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void setupSwitches() {
Switch show_full_zen = view.findViewById(R.id.show_full_zen);
Switch hu_notif = view.findViewById(R.id.hu_notif);
Switch vol_warn = view.findViewById(R.id.vol_warn);
Switch power_notifs = view.findViewById(R.id.power_notifications);
Switch clock_seconds = view.findViewById(R.id.clock_seconds);
Switch battery_percent = view.findViewById(R.id.battery_percent);
CardView power_notif_controls = view.findViewById(R.id.power_notification_controls_card);
//noinspection deprecation
battery_percent.setText(Html.fromHtml(getResources().getText(R.string.battery_percentage) + "<br /><small> <font color=\"#777777\">" + getResources().getText(R.string.reboot_required) + "</font></small>"));
if (Build.VERSION.SDK_INT > 23) {
clock_seconds.setVisibility(View.VISIBLE); //only show switch if user is on Nougat or later
power_notif_controls.setVisibility(View.VISIBLE); //this is a Nougat feature; only show it on Nougat devices
} else {
clock_seconds.setVisibility(View.GONE);
power_notif_controls.setVisibility(View.GONE);
}
activity.setThings.switches(show_full_zen, SHOW_FULL_ZEN, SECURE, view); //switch listener
activity.setThings.switches(hu_notif, HUN_ENABLED, GLOBAL, view);
activity.setThings.switches(vol_warn, SAFE_AUDIO, GLOBAL, view);
activity.setThings.switches(clock_seconds, CLOCK_SECONDS, SECURE, view);
activity.setThings.switches(battery_percent, BATTERY_PERCENT, SYSTEM, view);
activity.setThings.switches(power_notifs, POW_NOTIFS, SECURE, view);
}
示例7: onCreate
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_insiderepo);
progressBar = (ProgressBar) findViewById(R.id.progress);
cardInfo = (CardView) findViewById(R.id.card_info);
cardReadme = (CardView) findViewById(R.id.card_readme);
readme = (TextView) findViewById(R.id.reporeadme);
title = (TextView) findViewById(R.id.title);
subtitle = (TextView) findViewById(R.id.subtitle);
url = (TextView) findViewById(R.id.url);
language = (TextView) findViewById(R.id.language);
stars_total = (TextView) findViewById(R.id.stars_total);
foks_total = (TextView) findViewById(R.id.forks_total);
toolbar = (Toolbar) findViewById(R.id.readme_toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setTitle("Repo Details");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
cardInfo.setVisibility(View.INVISIBLE);
cardReadme.setVisibility(View.INVISIBLE);
progressBar.setVisibility(View.VISIBLE);
SharedPref sharedPref = new SharedPref(getApplicationContext());
String uname = sharedPref.getUserName();
String repname = sharedPref.getreponame();
getReadme(sharedPref.getreponame(), sharedPref.getUserName());
}
示例8: onCreateView
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_people,container,false);
recyclerView = (RecyclerView) view.findViewById(R.id.people_recView);
searchView = (SearchView) view.findViewById(R.id.people_searchView1);
cardView = (CardView) view.findViewById(R.id.search_back_card1);
cardView.setVisibility(View.VISIBLE);
return view;
}
示例9: initData
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
public void initData() {
CollapsingToolbarLayout collapsingToolbarLayout = findViewById(R.id.collapsing_toolbar_layout);
Toolbar toolbar = findViewById(R.id.general_info_toolbar);
CardView cardView = findViewById(R.id.InfoActivity_card);
imageView = findViewById(R.id.general_info_image);
floatingActionButton = findViewById(R.id.general_info_fab);
radioGroup = findViewById(R.id.radiogroup);
buttons[0] = findViewById(R.id.radiogroup_others);
buttons[1] = findViewById(R.id.radiogroup_man);
buttons[2] = findViewById(R.id.radiogroup_woman);
nameEditText = findViewById(R.id.general_info_name_content);
ageEditText = findViewById(R.id.general_info_age_and_sex_content);
countryEditText = findViewById(R.id.general_info_country_content);
moreInfoEditText = findViewById(R.id.general_info_more_content);
setSupportActionBar(toolbar);
collapsingToolbarLayout.setTitle(" ");
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
imageView.setOnClickListener(this);
floatingActionButton.setOnClickListener(this);
//信息卡片只会出现一次
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (prefs.getBoolean("INFO_ACTIVITY_CARD", false)) {
cardView.setVisibility(View.GONE);
}
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
editor.putBoolean("INFO_ACTIVITY_CARD", true);
editor.apply();
}
示例10: setUpMaintainer
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void setUpMaintainer() {
CardView cardView = rootView.findViewById(R.id.aur_package_details_maintainer_card_view);
cardView.setVisibility(View.VISIBLE);
TextView maintainerLabelTextView = rootView.findViewById(R.id.aur_package_details_maintainer_label_text_view);
TextView maintainerTextView = rootView.findViewById(R.id.aur_package_details_maintainer_text_view);
TextView licenseTextView = rootView.findViewById(R.id.aur_package_details_license_text_view);
TextView upstreamUrlTextView = rootView.findViewById(R.id.aur_package_details_upstream_url_text_view);
// responseAurInfoResultMaintainer
if (responseAurInfoResult.maintainer != null) {
if (responseAurInfoResult.maintainer.isEmpty()) {
maintainerTextView.setText(resources.getString(R.string.orphan));
maintainerTextView.setTextColor(ContextCompat.getColor(context, R.color.text_alert_red));
maintainerLabelTextView.setTextColor(ContextCompat.getColor(context, R.color.text_alert_red));
} else {
maintainerTextView.setText(responseAurInfoResult.maintainer);
}
} else {
maintainerTextView.setText(resources.getString(R.string.orphan));
maintainerTextView.setTextColor(ContextCompat.getColor(context, R.color.text_alert_red));
maintainerLabelTextView.setTextColor(ContextCompat.getColor(context, R.color.text_alert_red));
}
// license
if (responseAurInfoResult.license != null) {
licenseTextView.setText(responseAurInfoResult.license.isEmpty() ?
resources.getString(R.string.not_available)
: getFormattedStringList(responseAurInfoResult.license, false, ", "));
}
// upstream url
if (responseAurInfoResult.uRL != null) {
upstreamUrlTextView.setText(TextUtils.isEmpty(responseAurInfoResult.uRL) ?
resources.getString(R.string.not_available)
: responseAurInfoResult.uRL);
}
}
示例11: setUpDepends
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void setUpDepends() {
CardView dependsCardView = rootView.findViewById(R.id.aur_package_details_depends_card_view);
TextView dependsLabelTextView = rootView.findViewById(R.id.aur_package_details_depends_label_text_view);
TextView dependsTextView = rootView.findViewById(R.id.aur_package_details_depends_text_view);
if (responseAurInfoResult.depends != null && !responseAurInfoResult.depends.isEmpty()) {
dependsCardView.setVisibility(View.VISIBLE);
dependsLabelTextView.setText(resources.getQuantityString(R.plurals.plurals_formatted_depends,
responseAurInfoResult.depends.size(),
responseAurInfoResult.depends.size()));
dependsTextView.setText(getFormattedStringList(responseAurInfoResult.depends, true, "\n"));
} else {
dependsCardView.setVisibility(View.GONE);
}
}
示例12: setUpMakeDepends
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void setUpMakeDepends() {
CardView makeDependsCardView = rootView.findViewById(R.id.aur_package_details_make_depends_card_view);
TextView makeDependsLabelTextView = rootView.findViewById(R.id.aur_package_details_make_depends_label_text_view);
TextView makeDependsTextView = rootView.findViewById(R.id.aur_package_details_make_depends_text_view);
if (responseAurInfoResult.makeDepends != null && !responseAurInfoResult.makeDepends.isEmpty()) {
makeDependsCardView.setVisibility(View.VISIBLE);
makeDependsLabelTextView.setText(resources.getQuantityString(R.plurals.plurals_formatted_make_depends,
responseAurInfoResult.makeDepends.size(),
responseAurInfoResult.makeDepends.size()));
makeDependsTextView.setText(getFormattedStringList(responseAurInfoResult.makeDepends, true, "\n"));
} else {
makeDependsCardView.setVisibility(View.GONE);
}
}
示例13: setUpOptionalDepends
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void setUpOptionalDepends() {
CardView optionalDependsCardView = rootView.findViewById(R.id.aur_package_details_optional_depends_card_view);
TextView optionalDependsLabelTextView = rootView.findViewById(R.id.aur_package_details_optional_depends_label_text_view);
TextView optionalDependsTextView = rootView.findViewById(R.id.aur_package_details_optional_depends_text_view);
if (responseAurInfoResult.optDepends != null && !responseAurInfoResult.optDepends.isEmpty()) {
optionalDependsCardView.setVisibility(View.VISIBLE);
optionalDependsLabelTextView.setText(resources.getQuantityString(R.plurals.plurals_formatted_optional_depends,
responseAurInfoResult.optDepends.size(),
responseAurInfoResult.optDepends.size()));
optionalDependsTextView.setText(getFormattedStringList(responseAurInfoResult.optDepends, true, "\n"));
} else {
optionalDependsCardView.setVisibility(View.GONE);
}
}
示例14: setUpProvides
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void setUpProvides() {
CardView providesCardView = rootView.findViewById(R.id.aur_package_details_provides_card_view);
TextView providesLabelTextView = rootView.findViewById(R.id.aur_package_details_provides_label_text_view);
TextView providesTextView = rootView.findViewById(R.id.aur_package_details_provides_text_view);
if (responseAurInfoResult.provides != null && !responseAurInfoResult.provides.isEmpty()) {
providesCardView.setVisibility(View.VISIBLE);
providesLabelTextView.setText(resources.getString(R.string.formatted_provides,
responseAurInfoResult.provides.size()));
providesTextView.setText(getFormattedStringList(responseAurInfoResult.provides, true, "\n"));
} else {
providesCardView.setVisibility(View.GONE);
}
}
示例15: setUpConflicts
import android.support.v7.widget.CardView; //导入方法依赖的package包/类
private void setUpConflicts() {
CardView conflictsCardView = rootView.findViewById(R.id.aur_package_details_conflicts_card_view);
TextView conflictsLabelTextView = rootView.findViewById(R.id.aur_package_details_conflicts_label_text_view);
TextView conflictsTextView = rootView.findViewById(R.id.aur_package_details_conflicts_text_view);
if (responseAurInfoResult.conflicts != null && !responseAurInfoResult.conflicts.isEmpty()) {
conflictsCardView.setVisibility(View.VISIBLE);
conflictsLabelTextView.setText(resources.getQuantityString(R.plurals.plurals_formatted_conflicts,
responseAurInfoResult.conflicts.size(),
responseAurInfoResult.conflicts.size()));
conflictsTextView.setText(getFormattedStringList(responseAurInfoResult.conflicts, true, "\n"));
} else {
conflictsCardView.setVisibility(View.GONE);
}
}