本文整理汇总了Java中android.app.Fragment.isVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Fragment.isVisible方法的具体用法?Java Fragment.isVisible怎么用?Java Fragment.isVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.app.Fragment
的用法示例。
在下文中一共展示了Fragment.isVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayContact
import android.app.Fragment; //导入方法依赖的package包/类
public void displayContact(LinphoneContact contact, boolean chatOnly) {
Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.CONTACT_DETAIL) {
ContactDetailsFragment contactFragment = (ContactDetailsFragment) fragment2;
contactFragment.changeDisplayedContact(contact);
} else {
Bundle extras = new Bundle();
extras.putSerializable("Contact", contact);
extras.putBoolean("ChatAddressOnly", chatOnly);
changeCurrentFragment(FragmentsAvailable.CONTACT_DETAIL, extras);
}
}
示例2: onGoalAchieved
import android.app.Fragment; //导入方法依赖的package包/类
@Override
public void onGoalAchieved(DCGoal goal) {
Fragment fragment = getFragmentManager().findFragmentByTag(DCMessageFragment.TAG);
if (routine != null || (fragment != null && fragment.isVisible())) {
return;
}
DCGoalDialogFragment goalFragment = new DCGoalDialogFragment();
Bundle arguments = new Bundle();
arguments.putSerializable(DCGoalDialogFragment.KEY_GOAL, goal);
goalFragment.setArguments(arguments);
goalFragment.show(getFragmentManager(), DCGoalDialogFragment.TAG);
hideTutorials();
}
示例3: displayHistoryDetail
import android.app.Fragment; //导入方法依赖的package包/类
public void displayHistoryDetail(String sipUri, LinphoneCallLog log) {
LinphoneAddress lAddress;
try {
lAddress = LinphoneCoreFactory.instance().createLinphoneAddress(sipUri);
} catch (LinphoneCoreException e) {
Log.e("Cannot display history details",e);
//TODO display error message
return;
}
LinphoneContact c = ContactsManager.getInstance().findContactFromAddress(lAddress);
String displayName = c != null ? c.getFullName() : LinphoneUtils.getAddressDisplayName(sipUri);
String pictureUri = c != null && c.getPhotoUri() != null ? c.getPhotoUri().toString() : null;
String status;
if (log.getDirection() == CallDirection.Outgoing) {
status = getString(R.string.outgoing);
} else {
if (log.getStatus() == CallStatus.Missed) {
status = getString(R.string.missed);
} else {
status = getString(R.string.incoming);
}
}
String callTime = secondsToDisplayableString(log.getCallDuration());
String callDate = String.valueOf(log.getTimestamp());
Fragment fragment2 = getFragmentManager().findFragmentById(R.id.fragmentContainer2);
if (fragment2 != null && fragment2.isVisible() && currentFragment == FragmentsAvailable.HISTORY_DETAIL) {
HistoryDetailFragment historyDetailFragment = (HistoryDetailFragment) fragment2;
historyDetailFragment.changeDisplayedHistory(lAddress.asStringUriOnly(), displayName, pictureUri, status, callTime, callDate);
} else {
Bundle extras = new Bundle();
extras.putString("SipUri", lAddress.asString());
if (displayName != null) {
extras.putString("DisplayName", displayName);
extras.putString("PictureUri", pictureUri);
}
extras.putString("CallStatus", status);
extras.putString("CallTime", callTime);
extras.putString("CallDate", callDate);
changeCurrentFragment(FragmentsAvailable.HISTORY_DETAIL, extras);
}
}