Skip to content

Commit

Permalink
Add uikit to experimental/examples/imageviewer (#2571)
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-avdeev-jb authored Dec 22, 2022
1 parent d645b08 commit a9ac763
Show file tree
Hide file tree
Showing 188 changed files with 2,553 additions and 3,608 deletions.
15 changes: 15 additions & 0 deletions artwork/imageviewerrepo/pictures.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[
{"big": "1.jpg", "small": "small/1.jpg"},
{"big": "2.jpg", "small": "small/2.jpg"},
{"big": "3.jpg", "small": "small/3.jpg"},
{"big": "4.jpg", "small": "small/4.jpg"},
{"big": "5.jpg", "small": "small/5.jpg"},
{"big": "6.jpg", "small": "small/6.jpg"},
{"big": "7.jpg", "small": "small/7.jpg"},
{"big": "8.jpg", "small": "small/8.jpg"},
{"big": "9.jpg", "small": "small/9.jpg"},
{"big": "10.jpg", "small": "small/10.jpg"},
{"big": "11.jpg", "small": "small/11.jpg"},
{"big": "12.jpg", "small": "small/12.jpg"},
{"big": "13.jpg", "small": "small/13.jpg"}
]
Binary file added artwork/imageviewerrepo/small/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/10.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/12.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/13.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/6.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/7.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/8.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/imageviewerrepo/small/9.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions experimental/examples/imageviewer/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ build/
/captures
.externalNativeBuild
.cxx
iosApp/Podfile.lock
iosApp/Pods/*
iosApp/Imageviewer.xcworkspace/*
iosApp/Imageviewer.xcodeproj/*
!iosApp/Imageviewer.xcodeproj/project.pbxproj
shared/shared.podspec
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="desktop" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="desktopApp" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/desktop" />
<option name="externalProjectPath" value="$PROJECT_DIR$/desktopApp" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
Expand All @@ -15,7 +15,9 @@
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="iosApp (AndroidStudio)" type="KmmRunConfiguration" factoryName="iOS Application" CONFIG_VERSION="1" XCODE_PROJECT="$PROJECT_DIR$/iosApp/Imageviewer.xcworkspace" XCODE_CONFIGURATION="Debug" XCODE_SCHEME="Imageviewer">
<method v="2">
<option name="com.jetbrains.kmm.ios.BuildIOSAppTask" enabled="true" />
</method>
</configuration>
</component>
11 changes: 11 additions & 0 deletions experimental/examples/imageviewer/.run/iosApp.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="iosApp" type="AppleRunConfiguration" factoryName="Application" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" PASS_PARENT_ENVS_2="true" PROJECT_NAME="Imageviewer" TARGET_NAME="Imageviewer" CONFIG_NAME="Debug" IS_LOCATION_SIMULATION_SUPPORTED="true" SCHEME_NAME="iosApp" IS_LOCATION_SIMULATION_ALLOWED="true" LOCATION_SCENARIO_ID="com.apple.dt.IDEFoundation.CurrentLocationScenarioIdentifier" LOCATION_SCENARIO_TYPE="1" APPLICATION_LANGUAGE="IDELaunchSchemeLanguageUseSystemLanguage" APPLICATION_REGION="" RUN_TARGET_PROJECT_NAME="Imageviewer" RUN_TARGET_NAME="Imageviewer" MAKE_ACTIVE="TRUE" SHOULD_DEBUG_EXTENSIONS="false">
<EXTENSION ID="org.jetbrains.appcode.reveal.RevealRunConfigurationExtension">
<REVEAL_SETTINGS autoInject="false" autoInstall="true" askToEnableAutoInstall="true" />
</EXTENSION>
<embedded_app_extension_list />
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
26 changes: 21 additions & 5 deletions experimental/examples/imageviewer/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
An example of image gallery for remote server image viewing, based on Jetpack Compose UI library (desktop and android).
# Imageviewer

### Running desktop application
* To run, launch command: `./gradlew :desktop:run`
* Or choose **desktop** configuration in IDE and run it.
![desktop-run-configuration.png](screenshots/desktop-run-configuration.png)
An example of image gallery for remote server image viewing,
based on Compose Multiplatform UI library (desktop, android and iOS).

## How to run

Choose a run configuration for an appropriate target in IDE and run it.

![run-configurations.png](run-configurations.png)

To run on iOS device, please correct `iosApp/Configuration/TeamId.xcconfig` with your Apple Team ID.
Alternatively, you may setup signing within XCode opening `iosApp/Imageviewer.xcworkspace` and then
using "Signing & Capabilities" tab of `ImageViewer` target.

Then choose **iosApp** configuration in IDE and run it
(may also be referred as `ImageViewer` in the Run Configurations or `iosApp (AndroidStudio)` for Android studio).

## Run on desktop via Gradle

`./gradlew desktopApp:run`

### Building native desktop distribution

```
./gradlew :desktop:packageDistributionForCurrentOS
# outputs are written to desktop/build/compose/binaries
Expand Down
26 changes: 0 additions & 26 deletions experimental/examples/imageviewer/android/build.gradle.kts

This file was deleted.

This file was deleted.

33 changes: 33 additions & 0 deletions experimental/examples/imageviewer/androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
kotlin("multiplatform")
id("com.android.application")
id("org.jetbrains.compose")
}

kotlin {
android()
sourceSets {
val androidMain by getting {
dependencies {
implementation(project(":shared"))
implementation("androidx.appcompat:appcompat:1.5.1")
implementation("androidx.activity:activity-compose:1.6.1")
}
}
}
}

android {
compileSdk = 33
defaultConfig {
applicationId = "org.jetbrains.imageviewer"
minSdk = 24
targetSdk = 33
versionCode = 1
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

<application
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example.imageviewer

import android.os.Bundle
import androidx.activity.compose.setContent
import androidx.appcompat.app.AppCompatActivity
import example.imageviewer.view.ImageViewerAndroid

class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
ImageViewerAndroid()
}
}
}
1 change: 1 addition & 0 deletions experimental/examples/imageviewer/build.gradle.kts
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ allprojects {
google()
mavenCentral()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
mavenLocal()
}
}
54 changes: 0 additions & 54 deletions experimental/examples/imageviewer/common/build.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit a9ac763

Please sign in to comment.