當前位置: 首頁>>代碼示例>>Java>>正文


Java Fragment.isVisible方法代碼示例

本文整理匯總了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);
	}
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:13,代碼來源:LinphoneActivity.java

示例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();
}
 
開發者ID:Dentacoin,項目名稱:aftercare-app-android,代碼行數:15,代碼來源:DCDashboardActivity.java

示例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);
	}
}
 
開發者ID:treasure-lau,項目名稱:Linphone4Android,代碼行數:47,代碼來源:LinphoneActivity.java


注:本文中的android.app.Fragment.isVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。