本文整理匯總了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);
}
}