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


Java DialerFragment類代碼示例

本文整理匯總了Java中com.csipsimple.ui.dialpad.DialerFragment的典型用法代碼示例。如果您正苦於以下問題:Java DialerFragment類的具體用法?Java DialerFragment怎麽用?Java DialerFragment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DialerFragment類屬於com.csipsimple.ui.dialpad包,在下文中一共展示了DialerFragment類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onCreate

import com.csipsimple.ui.dialpad.DialerFragment; //導入依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {

    //prefWrapper = new PreferencesWrapper(this);
    prefProviderWrapper = new PreferencesProviderWrapper(this);

    super.onCreate(savedInstanceState);

    setContentView(R.layout.sip_home);

    final ActionBar ab = getSupportActionBar();
    ab.setDisplayShowHomeEnabled(false);
    ab.setDisplayShowTitleEnabled(false);
    ab.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
    // ab.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

    // showAbTitle = Compatibility.hasPermanentMenuKey

    

    Tab dialerTab = ab.newTab()
             .setContentDescription(R.string.dial_tab_name_text)
            .setIcon(R.drawable.ic_ab_dialer_holo_dark);
    Tab callLogTab = ab.newTab()
             .setContentDescription(R.string.calllog_tab_name_text)
            .setIcon(R.drawable.ic_ab_history_holo_dark);
    Tab favoritesTab = null;
    if(CustomDistribution.supportFavorites()) {
        favoritesTab = ab.newTab()
                .setContentDescription(R.string.favorites_tab_name_text)
                .setIcon(R.drawable.ic_ab_favourites_holo_dark);
    }
    Tab messagingTab = null;
    if (CustomDistribution.supportMessaging()) {
        messagingTab = ab.newTab()
                .setContentDescription(R.string.messages_tab_name_text)
                .setIcon(R.drawable.ic_ab_text_holo_dark);
    }
    
    warningTab = ab.newTab().setIcon(android.R.drawable.ic_dialog_alert);
    warningTabfadeAnim = ObjectAnimator.ofInt(warningTab.getIcon(), "alpha", 255, 100);
    warningTabfadeAnim.setDuration(1500);
    warningTabfadeAnim.setRepeatCount(ValueAnimator.INFINITE);
    warningTabfadeAnim.setRepeatMode(ValueAnimator.REVERSE);
    
    mDualPane = getResources().getBoolean(R.bool.use_dual_panes);

    mViewPager = (ViewPager) findViewById(R.id.pager);
    mTabsAdapter = new TabsAdapter(this, getSupportActionBar(), mViewPager);
    mTabsAdapter.addTab(dialerTab, DialerFragment.class, TAB_ID_DIALER);
    mTabsAdapter.addTab(callLogTab, CallLogListFragment.class, TAB_ID_CALL_LOG);
    if(favoritesTab != null) {
        mTabsAdapter.addTab(favoritesTab, FavListFragment.class, TAB_ID_FAVORITES);
    }
    if (messagingTab != null) {
        mTabsAdapter.addTab(messagingTab, ConversationsListFragment.class, TAB_ID_MESSAGES);
    }
    

    hasTriedOnceActivateAcc = false;

    if (!prefProviderWrapper.getPreferenceBooleanValue(SipConfigManager.PREVENT_SCREEN_ROTATION)) {
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
    }

    selectTabWithAction(getIntent());
    Log.setLogLevel(prefProviderWrapper.getLogLevel());
    

    // Async check
    asyncSanityChecker = new Thread() {
        public void run() {
            asyncSanityCheck();
        };
    };
    asyncSanityChecker.start();
    
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:79,代碼來源:SipHome.java

示例2: onAttachFragment

import com.csipsimple.ui.dialpad.DialerFragment; //導入依賴的package包/類
@Override
public void onAttachFragment(Fragment fragment) {
    // This method can be called before onCreate(), at which point we cannot
    // rely on ViewPager.
    // In that case, we will setup the "current position" soon after the
    // ViewPager is ready.
    final int currentPosition = mViewPager != null ? mViewPager.getCurrentItem() : -1;
    Integer tabId = null; 
    if(mTabsAdapter != null) {
        tabId = mTabsAdapter.getIdForPosition(currentPosition);
    }
    if (fragment instanceof DialerFragment) {
        mDialpadFragment = (DialerFragment) fragment;
        if (initTabId == tabId && tabId != null && tabId == TAB_ID_DIALER) {
            mDialpadFragment.onVisibilityChanged(true);
            initTabId = null;
        }
        if(initDialerWithText != null) {
            mDialpadFragment.setTextDialing(true);
            mDialpadFragment.setTextFieldValue(initDialerWithText);
            initDialerWithText = null;
        }
    } else if (fragment instanceof CallLogListFragment) {
        mCallLogFragment = (CallLogListFragment) fragment;
        if (initTabId == tabId && tabId != null && tabId == TAB_ID_CALL_LOG) {
            mCallLogFragment.onVisibilityChanged(true);
            initTabId = null;
        }
    } else if (fragment instanceof ConversationsListFragment) {
        mMessagesFragment = (ConversationsListFragment) fragment;
        if (initTabId == tabId && tabId != null && tabId == TAB_ID_MESSAGES) {
            mMessagesFragment.onVisibilityChanged(true);
            initTabId = null;
        }
    } else if (fragment instanceof FavListFragment) {
        mPhoneFavoriteFragment = (FavListFragment) fragment;
        if (initTabId == tabId && tabId != null && tabId == TAB_ID_FAVORITES) {
            mPhoneFavoriteFragment.onVisibilityChanged(true);
            initTabId = null;
        }
    } else if (fragment instanceof WarningFragment) {
        mWarningFragment = (WarningFragment) fragment;
        synchronized (warningList) {
            mWarningFragment.setWarningList(warningList);
            mWarningFragment.setOnWarningChangedListener(this);
        }
        
    }

}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:51,代碼來源:SipHome.java


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