当前位置: 首页>>代码示例>>Java>>正文


Java SpannableUtils类代码示例

本文整理汇总了Java中com.playuav.android.utils.SpannableUtils的典型用法代码示例。如果您正苦于以下问题:Java SpannableUtils类的具体用法?Java SpannableUtils怎么用?Java SpannableUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SpannableUtils类属于com.playuav.android.utils包,在下文中一共展示了SpannableUtils类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: run

import com.playuav.android.utils.SpannableUtils; //导入依赖的package包/类
@Override
public void run() {
    mHandler.removeCallbacks(this);
    if (drone == null || !drone.isConnected())
        return;

    if(mInboxBuilder != null) {
        long timeInSeconds = drone.getFlightTime();
        long minutes = timeInSeconds / 60;
        long seconds = timeInSeconds % 60;

        mInboxBuilder.setLine(2, SpannableUtils.normal("Air Time:   ",
                SpannableUtils.bold(String.format("%02d:%02d", minutes, seconds))));
    }

    mHandler.postDelayed(this, FLIGHT_TIMER_PERIOD);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:18,代码来源:StatusBarNotificationProvider.java

示例2: updateRadio

import com.playuav.android.utils.SpannableUtils; //导入依赖的package包/类
private void updateRadio(Drone drone) {
	if (mInboxBuilder == null)
		return;

       Signal droneSignal = drone.getSignal();
       String update = droneSignal == null ? "--" : String.format("%d%%", MathUtils.getSignalStrength(droneSignal
               .getFadeMargin(), droneSignal.getRemFadeMargin()));
	mInboxBuilder.setLine(4, SpannableUtils.normal("Signal:   ", SpannableUtils.bold(update)));
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:10,代码来源:StatusBarNotificationProvider.java

示例3: updateHome

import com.playuav.android.utils.SpannableUtils; //导入依赖的package包/类
private void updateHome(Drone drone) {
	if (mInboxBuilder == null)
		return;

       String update = "--";
           final Gps droneGps = this.drone.getGps();
           final Home droneHome = this.drone.getHome();
           if(droneGps != null && droneGps.isValid() && droneHome != null && droneHome.isValid()) {
               double distanceToHome = MathUtils.getDistance(droneHome.getCoordinate(),
                       droneGps.getPosition());
               update = String.format("Home\n%s", UnitManager.getUnitProvider().distanceToString
                       (distanceToHome));
           }
	mInboxBuilder.setLine(0, SpannableUtils.normal("Home:   ", update));
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:16,代码来源:StatusBarNotificationProvider.java

示例4: updateGps

import com.playuav.android.utils.SpannableUtils; //导入依赖的package包/类
private void updateGps(Drone drone) {
	if (mInboxBuilder == null)
		return;

       Gps droneGps = drone.getGps();
       String update = droneGps == null ? "--" : String.format(
               "%d, %s", droneGps.getSatellitesCount(), droneGps.getFixType());
	mInboxBuilder.setLine(1, SpannableUtils.normal("Satellite:   ", SpannableUtils.bold(update)));
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:10,代码来源:StatusBarNotificationProvider.java

示例5: updateBattery

import com.playuav.android.utils.SpannableUtils; //导入依赖的package包/类
private void updateBattery(Drone drone) {
	if (mInboxBuilder == null)
		return;

       Battery droneBattery = drone.getBattery();
       String update = droneBattery == null ? "--" : String.format(
               "%2.1fv (%2.0f%%)", droneBattery.getBatteryVoltage(),
               droneBattery.getBatteryRemain());

	mInboxBuilder.setLine(3, SpannableUtils.normal("Battery:   ", SpannableUtils.bold(update)));
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:12,代码来源:StatusBarNotificationProvider.java

示例6: updateFlightMode

import com.playuav.android.utils.SpannableUtils; //导入依赖的package包/类
private void updateFlightMode(Drone drone) {
	if (mNotificationBuilder == null)
		return;

       State droneState = drone.getState();
       VehicleMode mode = droneState == null ? null : droneState.getVehicleMode();
       String update = mode == null ? "--" : mode.getLabel();
	final CharSequence modeSummary = SpannableUtils.normal("Flight Mode:  ", SpannableUtils.bold(update));
	mNotificationBuilder.setContentTitle(modeSummary);
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:11,代码来源:StatusBarNotificationProvider.java


注:本文中的com.playuav.android.utils.SpannableUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。