小编SAN*_*NAT的帖子

Recyclerview滚动期间更改项目

我有一个RecyclerView.每行都有一个播放按钮,textview和Progressbar.单击播放按钮时必须播放我的SD卡中的音频并且必须进度Progressbar问题是当我向下滚动recyclerview时,请更改下一行中的Progressbar.意思是我可以同时在屏幕上显示5个项目.当我滚动到第6行,第6行搜索栏突然改变.

public class ListAdapter extends RecyclerView.Adapter {

    private List<Historyitem> stethitems;
    public Context mContext;
    public Activity activity;
    public Handler mHandler;

    static MediaPlayer mPlayer;
    static Timer mTimer;

    public ListAdapter(Activity activity,Context mContext,List<Historyitem> stethitems) {
        this.stethitems = stethitems;
        this.mContext = mContext;
        this.activity = activity;
    }

    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {

        View rootView = LayoutInflater.
                from(mContext).inflate(R.layout.stethoscopeadapteritem, null, false);
        RecyclerView.LayoutParams lp = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);
        rootView.setLayoutParams(lp);
        mHandler = new Handler();
        return new MyViewHolder(rootView);
    }

    @Override
    public void onBindViewHolder(final RecyclerView.ViewHolder viewHolder, int position) { …
Run Code Online (Sandbox Code Playgroud)

android android-scrollview android-recyclerview

57
推荐指数
6
解决办法
6万
查看次数

使用视觉api在脸上拍摄可绘画/油漆

我在想什么?

我试图用可绘画/油漆在脸上拍照,但是,我无法在同一张照片上同时拍摄.

在此输入图像描述

我试过了什么?

我尝试过使用,CameraSource.takePicture但我只是脸上没有任何可绘画/油漆.

mCameraSource.takePicture(shutterCallback, new CameraSource.PictureCallback() {
            @Override
            public void onPictureTaken(byte[] bytes) {
                try {
                    String mainpath = getExternalStorageDirectory() + separator + "TestXyz" + separator + "images" + separator;
                    File basePath = new File(mainpath);
                    if (!basePath.exists())
                        Log.d("CAPTURE_BASE_PATH", basePath.mkdirs() ? "Success": "Failed");
                    String path = mainpath + "photo_" + getPhotoTime() + ".jpg";
                    File captureFile = new File(path);
                    captureFile.createNewFile();
                    if (!captureFile.exists())
                        Log.d("CAPTURE_FILE_PATH", captureFile.createNewFile() ? "Success": "Failed");
                    FileOutputStream stream = new FileOutputStream(captureFile);
                    stream.write(bytes);
                    stream.flush();
                    stream.close();
                } catch (IOException e) { …
Run Code Online (Sandbox Code Playgroud)

android google-vision vision-api

15
推荐指数
3
解决办法
2762
查看次数

应用内更新检查它是AppUpdateType.FLEXIBLE还是AppUpdateType.IMMEDIATE

Playstore控制台中是否有任何选项可配置此值?

这是官方文件。码:

// Creates instance of the manager.
AppUpdateManager appUpdateManager = AppUpdateManagerFactory.create(context);

// Returns an intent object that you use to check for an update.
Task<AppUpdateInfo> appUpdateInfoTask = appUpdateManager.getAppUpdateInfo();

// Checks that the platform will allow the specified type of update.
appUpdateInfoTask.addOnSuccessListener(appUpdateInfo -> {
    if (appUpdateInfo.updateAvailability() == UpdateAvailability.UPDATE_AVAILABLE
          // For a flexible update, use AppUpdateType.FLEXIBLE
          && appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)) {
              // Request the update.
    }
});
Run Code Online (Sandbox Code Playgroud)

我们如何知道:

appUpdateInfo.isUpdateTypeAllowed(AppUpdateType.IMMEDIATE)
Run Code Online (Sandbox Code Playgroud)

在哪里配置以上类型?官方文档中没有相关描述。

在AppUpdateInfo.class中:

public final boolean isUpdateTypeAllowed(int var1) {
        if (var1 == 0) {
            return …
Run Code Online (Sandbox Code Playgroud)

android in-app-update google-play-core

11
推荐指数
2
解决办法
448
查看次数

使用不支持多语言环境(语言)的 travis 构建应用程序

我正在开发支持多种语言环境(语言)的项目。该应用程序通过直接从 Android Studio 安装或使用 Android Studio 构建应用程序来支持多种语言。但是当我们通过travis构建应用程序时,只支持英语。我曾尝试通过手机更改多种支持的语言,但它不起作用。

我想实现什么?

我想支持多种语言环境(语言),哪些语言 string.xml 已经在项目中可用。当用户更改手机语言时,通过 travis 构建的应用程序应支持英语以外的其他语言。

注意:为此,不需要代码和重现步骤。

如果有人对这个问题有想法,请告诉我,谢谢。

评论中要求的代码:

构建变量代码:

buildTypes {
    betaUAT {
        debuggable true
        versionNameSuffix "-BETA-UAT"
        applicationIdSuffix "uat"
        buildConfigField "boolean", "DEVELOPER_MODE", "false"
        buildConfigField "boolean", "EXTRA_LOGGING", "true"
        buildConfigField "String", "ENV", "\"UAT\""

        signingConfig signingConfigs.demo
    }
}
Run Code Online (Sandbox Code Playgroud)

命令:

appcenter distribute release -f "$APK_FILE" -g "$GROUP_NAME" -r "$RELEASE_NOTES" --app "$OWNER_NAME/$APP_NAME"
Run Code Online (Sandbox Code Playgroud)

android gradle travis-ci android-studio

10
推荐指数
1
解决办法
263
查看次数

在应用程序购买中:两个具有相同帐户的设备未获得相同的购买项目

我在想什么?

在一个已配置X电子邮件地址的Android设备中购买商品.当我签入另一台配置了相同电子邮件地址的设备时.但在第一台设备上购买的商品无法在其他设备上使用.

我试过了什么?

我尝试过使用:

inappBillingService.getPurchases(InAppBuyActivity.INAPPVERSION,
                    getPackageName(), "inapp", null);
Run Code Online (Sandbox Code Playgroud)

并尝试使用:

IabHelper.QueryInventoryFinishedListener mGotInventoryListener
   = new IabHelper.QueryInventoryFinishedListener() {
   public void onQueryInventoryFinished(IabResult result,
      Inventory inventory) {

      if (result.isFailure()) {
        // handle error here
      }
      else {
        // Not getting same purchased on both devices
      }
   }
};
Run Code Online (Sandbox Code Playgroud)

我正在生成签名的apk,其版本名称和版本代码与playstore版本相同.

android in-app-billing

7
推荐指数
1
解决办法
753
查看次数