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


Java TextUtils.join方法代码示例

本文整理汇总了Java中android.text.TextUtils.join方法的典型用法代码示例。如果您正苦于以下问题:Java TextUtils.join方法的具体用法?Java TextUtils.join怎么用?Java TextUtils.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.text.TextUtils的用法示例。


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

示例1: getGeofenceTransitionDetails

import android.text.TextUtils; //导入方法依赖的package包/类
/**
 * Gets transition details and returns them as a formatted string.
 *
 * @param context               The app context.
 * @param geofenceTransition    The ID of the geofence transition.
 * @param triggeringGeofences   The geofence(s) triggered.
 * @return                      The transition details formatted as String.
 */
private String getGeofenceTransitionDetails(
        Context context,
        int geofenceTransition,
        List<Geofence> triggeringGeofences) {

    String geofenceTransitionString = getTransitionString(geofenceTransition);

    // Get the Ids of each geofence that was triggered.
    ArrayList triggeringGeofencesIdsList = new ArrayList();
    for (Geofence geofence : triggeringGeofences) {
        triggeringGeofencesIdsList.add(geofence.getRequestId());
    }
    String triggeringGeofencesIdsString = TextUtils.join(", ",  triggeringGeofencesIdsList);

    return geofenceTransitionString + ": " + triggeringGeofencesIdsString;
}
 
开发者ID:RobinCaroff,项目名称:MyGeofencer,代码行数:25,代码来源:GeofenceTransitionsIntentService.java

示例2: FunctionRunner

import android.text.TextUtils; //导入方法依赖的package包/类
/**
 * Initialization; needs a context to find the classpath.
 * @param ctx
 */
public FunctionRunner(Context ctx) {
    /*
     * It would be nicer if we could just look at the classloaders for this class and
     * the one being run, but the details we need aren't publicly exposed there as far as
     * I can see. I'd rather do this than hack around with reflection or parsing classloaders'
     * toString().
     */
    ApplicationInfo appInfo = ctx.getApplicationInfo();
    mClassPath = appInfo.sourceDir + File.pathSeparator +
            TextUtils.join(File.pathSeparator, appInfo.splitSourceDirs);

    // and I guess there's really no better way for this either
    // TODO let caller optionally configure this?
    mCodeCacheDir = ctx.getCodeCacheDir().getPath();
}
 
开发者ID:scintill,项目名称:android-runas,代码行数:20,代码来源:FunctionRunner.java

示例3: RepoContentLoader

import android.text.TextUtils; //导入方法依赖的package包/类
public RepoContentLoader(Context context, String path, String repoName, String userName) {
    super(context);

    if (repoName == null || userName == null || repoName.isEmpty() || userName.isEmpty()) {
        isRepoReady = false;
    }

    String[] pathList = path.split("/");
    for (int i = 0; i < pathList.length; i++) {
        pathList[i] = Uri.encode(pathList[i]);
    }
    this.path = TextUtils.join("/", pathList);
    this.repoName = repoName;
    this.userName = userName;
    firebaseAnalytics = new FirebaseAnalyticsWrapper(context);
}
 
开发者ID:OlgaKuklina,项目名称:GitJourney,代码行数:17,代码来源:RepoContentLoader.java

示例4: iterableToString

import android.text.TextUtils; //导入方法依赖的package包/类
@Nullable
public static String iterableToString(@Nullable Iterable<String> strings) {
    if (strings == null) {
        return null;
    }

    Set<String> stringSet = new LinkedHashSet<>();
    for (String str : strings) {
        LiCoreSDKUtils.checkArgument(!TextUtils.isEmpty(str),
                "individual scopes cannot be null or empty");
        stringSet.add(str);
    }

    if (stringSet.isEmpty()) {
        return null;
    }

    return TextUtils.join(" ", stringSet);
}
 
开发者ID:lithiumtech,项目名称:li-android-sdk-core,代码行数:20,代码来源:LiCoreSDKUtils.java

示例5: updateScheduledTime

import android.text.TextUtils; //导入方法依赖的package包/类
public static void updateScheduledTime(Context context, Set<Long> noteIds, OrgDateTime time) {
    ArrayList<ContentProviderOperation> ops = new ArrayList<>();

    String noteIdsCommaSeparated = TextUtils.join(",", noteIds);

    /* Update notes. */
    ContentValues values = new ContentValues();

    if (time != null) {
        values.put(ProviderContract.Notes.UpdateParam.SCHEDULED_STRING, new OrgRange(time).toString());
    } else {
        values.putNull(ProviderContract.Notes.UpdateParam.SCHEDULED_STRING);
    }

    ops.add(ContentProviderOperation
            .newUpdate(ProviderContract.Notes.ContentUri.notes())
            .withValues(values)
            .withSelection(ProviderContract.Notes.UpdateParam._ID + " IN (" + noteIdsCommaSeparated + ")", null)
            .build());

    updateBooksMtimeForNotes(context, noteIdsCommaSeparated, ops);

    /*
     * Apply batch.
     */
    try {
        context.getContentResolver().applyBatch(ProviderContract.AUTHORITY, ops);
    } catch (RemoteException | OperationApplicationException e) {
        e.printStackTrace();
        throw new RuntimeException(e);
    }
}
 
开发者ID:orgzly,项目名称:orgzly-android,代码行数:33,代码来源:NotesClient.java

示例6: toString

import android.text.TextUtils; //导入方法依赖的package包/类
@Override
public String toString() {
    return TextUtils.join("|", new Object[] {
            responseCode, nonce, packageName, versionCode,
            userId, timestamp
    });
}
 
开发者ID:snoozinsquatch,项目名称:unity-obb-downloader,代码行数:8,代码来源:ResponseData.java

示例7: sortTableColumns

import android.text.TextUtils; //导入方法依赖的package包/类
private String sortTableColumns(String sql) {
    int positionOfColumnDefinitions = sql.indexOf('(');
    String columnDefinitionsSql = sql.substring(positionOfColumnDefinitions + 1, sql.length() - 1);
    String[] columnDefinitions = columnDefinitionsSql.split(" *, *(?![^(]*\\))");
    Arrays.sort(columnDefinitions);

    String sqlPrefix = sql.substring(0, positionOfColumnDefinitions + 1);
    String sortedColumnDefinitionsSql = TextUtils.join(", ", columnDefinitions);
    return sqlPrefix + sortedColumnDefinitionsSql + ")";
}
 
开发者ID:philipwhiuk,项目名称:q-mail,代码行数:11,代码来源:StoreSchemaDefinitionTest.java

示例8: restoreData

import android.text.TextUtils; //导入方法依赖的package包/类
private static void restoreData(StandardDatabase db, List<Class<? extends AbstractDao<?, ?>>> daoClasses) {
    for (Class<? extends AbstractDao<?, ?>> daoClass : daoClasses) {
        DaoConfig daoConfig = new DaoConfig(db, daoClass);
        String tableName = daoConfig.tablename;
        String tempTableName = daoConfig.tablename.concat("_TEMP");
        // get all columns from tempTable, take careful to use the columns list
        List<String> columns = getColumns(db, tempTableName);
        ArrayList<String> properties = new ArrayList<>(columns.size());
        for (int j = 0; j < daoConfig.properties.length; j++) {
            String columnName = daoConfig.properties[j].columnName;
            if (columns.contains(columnName)) {
                properties.add(columnName);
            }
        }
        if (properties.size() > 0) {
            final String columnSQL = TextUtils.join(",", properties);

            String insertTableStringBuilder = "INSERT INTO " + tableName + " (" +
                    columnSQL +
                    ") SELECT " +
                    columnSQL +
                    " FROM " + tempTableName + ";";
            try {
                db.execSQL(insertTableStringBuilder);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        db.execSQL("DROP TABLE " + tempTableName);
    }
}
 
开发者ID:cyrilpillai,项目名称:GreenDao-Migrator,代码行数:32,代码来源:MigrationHelper.java

示例9: joinNewline

import android.text.TextUtils; //导入方法依赖的package包/类
private static String joinNewline(String... args) {
    return TextUtils.join("\n", args);
}
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:4,代码来源:MediaDocumentsProvider.java

示例10: getObjectIdentifier

import android.text.TextUtils; //导入方法依赖的package包/类
private String getObjectIdentifier(){
    return TextUtils.join("", keys);
}
 
开发者ID:MobileDev418,项目名称:AndroidBackendlessChat,代码行数:4,代码来源:BPath.java

示例11: createErrorResult

import android.text.TextUtils; //导入方法依赖的package包/类
static Result createErrorResult(AuthorizationRequest request, String errorType, String errorDescription,
        String errorCode) {
    String message = TextUtils.join(": ", Utility.asListNoNulls(errorType, errorDescription));
    return new Result(request, Code.ERROR, null, message, errorCode);
}
 
开发者ID:MobileDev418,项目名称:chat-sdk-android-push-firebase,代码行数:6,代码来源:AuthorizationClient.java

示例12: orderBySql

import android.text.TextUtils; //导入方法依赖的package包/类
private String orderBySql() {
    if (orderBys.size() == 0) {
        return "";
    }
    return " ORDER BY " + TextUtils.join(", ", orderBys);
}
 
开发者ID:uhuru-mobile,项目名称:mobile-store,代码行数:7,代码来源:QueryBuilder.java

示例13: draw

import android.text.TextUtils; //导入方法依赖的package包/类
@Override
public void draw(Canvas canvas, Paint paint, float opacity) {
  if (mFrame == null) {
    return;
  }
  opacity *= mOpacity;
  if (opacity <= MIN_OPACITY_FOR_DRAW) {
    return;
  }
  if (!mFrame.hasKey(PROP_LINES)) {
    return;
  }
  ReadableArray linesProp = mFrame.getArray(PROP_LINES);
  if (linesProp == null || linesProp.size() == 0) {
    return;
  }

  // only set up the canvas if we have something to draw
  saveAndSetupCanvas(canvas);
  String[] lines = new String[linesProp.size()];
  for (int i = 0; i < lines.length; i++) {
    lines[i] = linesProp.getString(i);
  }
  String text = TextUtils.join("\n", lines);
  if (setupStrokePaint(paint, opacity)) {
    applyTextPropertiesToPaint(paint);
    if (mPath == null) {
      canvas.drawText(text, 0, -paint.ascent(), paint);
    } else {
      canvas.drawTextOnPath(text, mPath, 0, 0, paint);
    }
  }
  if (setupFillPaint(paint, opacity)) {
    applyTextPropertiesToPaint(paint);
    if (mPath == null) {
      canvas.drawText(text, 0, -paint.ascent(), paint);
    } else {
      canvas.drawTextOnPath(text, mPath, 0, 0, paint);
    }
  }
  restoreCanvas(canvas);
  markUpdateSeen();
}
 
开发者ID:qq565999484,项目名称:RNLearn_Project1,代码行数:44,代码来源:ARTTextShadowNode.java

示例14: CommandResult

import android.text.TextUtils; //导入方法依赖的package包/类
CommandResult(int returnCode, List<String> output) {
    this.exitCode = returnCode;
    this.output = TextUtils.join("\n", output);
}
 
开发者ID:Faerbit,项目名称:android-crond,代码行数:5,代码来源:IO.java

示例15: toString

import android.text.TextUtils; //导入方法依赖的package包/类
@Override
public String toString() {
    return TextUtils.join("|", new Object [] { responseCode, nonce, packageName, versionCode,
        userId, timestamp });
}
 
开发者ID:SlotNSlot,项目名称:SlotNSlot_Android,代码行数:6,代码来源:ResponseData.java


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