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


Java DateFormat.getDateFormat方法代碼示例

本文整理匯總了Java中android.text.format.DateFormat.getDateFormat方法的典型用法代碼示例。如果您正苦於以下問題:Java DateFormat.getDateFormat方法的具體用法?Java DateFormat.getDateFormat怎麽用?Java DateFormat.getDateFormat使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.text.format.DateFormat的用法示例。


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

示例1: onReceive

import android.text.format.DateFormat; //導入方法依賴的package包/類
@Override
public void onReceive(Context context, Intent intent) {
    mCalendar.setTimeZone(TimeZone.getDefault());
    dayOfWeekFormat = new SimpleDateFormat("EEEE", Locale.getDefault());
    dayOfWeekFormat.setCalendar(mCalendar);
    dateFormat = DateFormat.getDateFormat(MyWatchFace.this);
    dateFormat.setCalendar(mCalendar);
    invalidate();
}
 
開發者ID:changja88,項目名稱:Android_Sunshine_Watch,代碼行數:10,代碼來源:MyWatchFace.java

示例2: onCreate

import android.text.format.DateFormat; //導入方法依賴的package包/類
@Override
public void onCreate(SurfaceHolder holder) {
    super.onCreate(holder);

    setWatchFaceStyle(new WatchFaceStyle.Builder(MyWatchFace.this)
            .setCardPeekMode(WatchFaceStyle.PEEK_MODE_VARIABLE)
            .setBackgroundVisibility(WatchFaceStyle.BACKGROUND_VISIBILITY_INTERRUPTIVE)
            .setShowSystemUiTime(false)
            .build());
    Resources resources = MyWatchFace.this.getResources();

    googleApiClient = new GoogleApiClient.Builder(MyWatchFace.this)
            .addConnectionCallbacks(this)
            .addOnConnectionFailedListener(this)
            .addApi(Wearable.API)
            .build();
    googleApiClient.connect();

    // Colors
    mBackgroundPaint = new Paint();
    mBackgroundPaint.setColor(resources.getColor(R.color.orange));
    hourPaint = createTextPaint(resources.getColor(R.color.white));
    minutePaint = createTextPaint(resources.getColor(R.color.white));
    colonPaint = createTextPaint(resources.getColor(R.color.white));
    highPaint = createTextPaint(resources.getColor(R.color.white));
    lowPaint = createTextPaint(resources.getColor(R.color.white));

    // Initialize member variables
    mCalendar = Calendar.getInstance();
    date = new Date();
    dayOfWeekFormat = new SimpleDateFormat("EEEE", Locale.getDefault());
    dayOfWeekFormat.setCalendar(mCalendar);
    dateFormat = DateFormat.getDateFormat(MyWatchFace.this);
    dateFormat.setCalendar(mCalendar);
}
 
開發者ID:changja88,項目名稱:Android_Sunshine_Watch,代碼行數:36,代碼來源:MyWatchFace.java

示例3: AdapterBaseImpl

import android.text.format.DateFormat; //導入方法依賴的package包/類
protected AdapterBaseImpl(Context ctx_, int mode_)
{
    ctx = ctx_;
    mode = mode_;
    mInflater = (LayoutInflater) ctx.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    localeDateFormat = DateFormat.getDateFormat(ctx);
    localeTimeFormat = DateFormat.getTimeFormat(ctx);
    density = ctx.getResources().getDisplayMetrics().density;
}
 
開發者ID:mkulesh,項目名稱:microMathematics,代碼行數:10,代碼來源:AdapterBaseImpl.java

示例4: addCertificateDetails

import android.text.format.DateFormat; //導入方法依賴的package包/類
private void addCertificateDetails(Certificate cert, byte[] sha256Digest, byte[] sha1Digest) {
    LinearLayout certificateView = new LinearLayout(mContext);
    mViews.add(certificateView);
    certificateView.setOrientation(LinearLayout.VERTICAL);

    X509Certificate x509 = (X509Certificate) cert;
    SslCertificate sslCert = new SslCertificate(x509);

    mTitles.add(sslCert.getIssuedTo().getCName());

    addSectionTitle(certificateView, nativeGetCertIssuedToText());
    addItem(certificateView, nativeGetCertInfoCommonNameText(),
            sslCert.getIssuedTo().getCName());
    addItem(certificateView, nativeGetCertInfoOrganizationText(),
            sslCert.getIssuedTo().getOName());
    addItem(certificateView, nativeGetCertInfoOrganizationUnitText(),
            sslCert.getIssuedTo().getUName());
    addItem(certificateView, nativeGetCertInfoSerialNumberText(),
            formatBytes(x509.getSerialNumber().toByteArray(), ':'));

    addSectionTitle(certificateView, nativeGetCertIssuedByText());
    addItem(certificateView, nativeGetCertInfoCommonNameText(),
            sslCert.getIssuedBy().getCName());
    addItem(certificateView, nativeGetCertInfoOrganizationText(),
            sslCert.getIssuedBy().getOName());
    addItem(certificateView, nativeGetCertInfoOrganizationUnitText(),
            sslCert.getIssuedBy().getUName());

    addSectionTitle(certificateView, nativeGetCertValidityText());
    java.text.DateFormat dateFormat = DateFormat.getDateFormat(mContext);
    addItem(certificateView, nativeGetCertIssuedOnText(),
            dateFormat.format(sslCert.getValidNotBeforeDate()));
    addItem(certificateView, nativeGetCertExpiresOnText(),
            dateFormat.format(sslCert.getValidNotAfterDate()));

    addSectionTitle(certificateView, nativeGetCertFingerprintsText());
    addItem(certificateView, nativeGetCertSHA256FingerprintText(),
            formatBytes(sha256Digest, ' '));
    addItem(certificateView, nativeGetCertSHA1FingerprintText(),
            formatBytes(sha1Digest, ' '));
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:42,代碼來源:CertificateViewer.java


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