Skip to content

Conversation

@abhinaykukkadapu
Copy link
Contributor

While trying to use demo apps for the demo found few issues and this PR contains some of them i used to unblock:

  1. Make settings pane more responsive, before i had to click exactly on the corner of the dropdown and it was hard on a small screen
  2. Make settings pane scrollable as the device screen i have is small the clear button wouldn't show before
  3. fix llava prompt template (this is only a part of the fix), the model currently fails with error 17. I think xnnpack backend needed sine op to make llava work.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Dec 9, 2025

dataPathBuilder.create().show();
mDataPathTextView.setText("Loading...");
new Thread(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do not need a new Thread here, nor runOnUIThread. setupDataPathSelectorDialog() is already on the UI Thread, this can be as simple as

private void setupDataPathSelectorDialog() {
mDataPathTextView.setText("Loading...");

   String[] dataPathFiles =
              listLocalFile("/data/local/tmp/llama/", new String[] {".ptd"});
          runOnUiThread(
              () -> {
                mDataPathTextView.setText(
                    mDataPath != null ? getFilenameFromPath(mDataPath) : "no data path selected");
                AlertDialog.Builder dataPathBuilder = new AlertDialog.Builder(this);
                dataPathBuilder.setTitle("Select data path");

                String[] dataPathOptions = new String[dataPathFiles.length + 1];
                for (int i = 0; i < dataPathFiles.length; i++) {
                  dataPathOptions[i] = dataPathFiles[i];
                }
                dataPathOptions[dataPathOptions.length - 1] = "(unused)";

                dataPathBuilder.setSingleChoiceItems(
                    dataPathOptions,
                    -1,
                    (dialog, item) -> {
                      if (dataPathOptions[item] != "(unused)") {
                        mDataPath = dataPathOptions[item];
                        mDataPathTextView.setText(getFilenameFromPath(mDataPath));
                      } else {
                        mDataPath = null;
                        mDataPathTextView.setText(
                            getFilenameFromPath("no data path selected"));
                      }
                      mLoadModelButton.setEnabled(true);
                      dialog.dismiss();
                    });

                dataPathBuilder.create().show();

}

Can we do this to all the functions similarly ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @abhinaykukkadapu for this PR. This should help in addressing few UI issues

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@psiddh i think you are right, the non-responsiveness seems to stem from clicking the small icon at the corner, now it is still responsive. Modified in the latest patch.

@abhinaykukkadapu abhinaykukkadapu force-pushed the imrove_android_demo_app_uz branch from 2cfbaa7 to a6003df Compare December 11, 2025 00:55
@abhinaykukkadapu abhinaykukkadapu merged commit 9d0db45 into meta-pytorch:main Dec 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants