summaryrefslogtreecommitdiff
path: root/mobile/app/gallery-view-model.ts
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-01-26 14:51:36 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-01-26 14:52:57 +0100
commitd3bf2d09f740221771806789b00bf915c9f5f2e3 (patch)
tree95f99eabd763dff1907f107393504ee75aa747d7 /mobile/app/gallery-view-model.ts
parent466d03a38cb01e9ff9a2d11be113a81c2bdce34a (diff)
initial commitHEADmain
Diffstat (limited to 'mobile/app/gallery-view-model.ts')
-rw-r--r--mobile/app/gallery-view-model.ts51
1 files changed, 0 insertions, 51 deletions
diff --git a/mobile/app/gallery-view-model.ts b/mobile/app/gallery-view-model.ts
deleted file mode 100644
index e15839a..0000000
--- a/mobile/app/gallery-view-model.ts
+++ /dev/null
@@ -1,51 +0,0 @@
-import { AndroidActivityRequestPermissionsEventData, Application, Observable, Utils } from '@nativescript/core';
-
-export class GalleryModel extends Observable {
- constructor() {
- super();
- }
-
- peng() {
- const check = function () {
- return new Promise((resolve, reject) => {
- (Application.android.foregroundActivity || Application.android.startActivity).requestPermissions([
- android.Manifest.permission.READ_EXTERNAL_STORAGE,
- ], 1337);
- function onActivityResult(args) {
- if (args.requestCode === 1337) {
- Application.android.off(Application.android.activityRequestPermissionsEvent, onActivityResult);
- console.log(args);
- console.log(args.grantResults);
- resolve(args);
- }
- }
- Application.android.on(Application.android.activityRequestPermissionsEvent, onActivityResult);
- });
- }
-
-
- check().then(() => {
- console.log('query');
- const cursor = Utils.android.getApplicationContext().getContentResolver().query(
- android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
- [
- android.provider.MediaStore.Images.ImageColumns._ID,
- android.provider.MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,
- android.provider.MediaStore.Images.ImageColumns.DATE_TAKEN,
- ],
- '1) GROUP BY (' + android.provider.MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME,
- null,
- null
- );
-
- console.log(cursor, cursor.getCount());
- if (cursor) {
- console.log(cursor.moveToFirst());
-
- const bucketColumn = cursor.getColumnIndex(android.provider.MediaStore.Images.ImageColumns.BUCKET_DISPLAY_NAME);
- console.log(bucketColumn);
- // console.log(cursor.getString(bucketColumn));
- }
- });
- }
-}