├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── ic_paste-playstore.png
│ │ ├── res
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_paste.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_paste_round.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_paste.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_paste_round.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_paste.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_paste_round.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_paste.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_paste_round.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_paste.png
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_paste_round.png
│ │ │ │ └── ic_launcher_round.png
│ │ │ ├── values
│ │ │ │ ├── ic_paste_background.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── preloaded_fonts.xml
│ │ │ │ ├── styles.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── font_certs.xml
│ │ │ ├── xml
│ │ │ │ └── provider_path.xml
│ │ │ ├── mipmap-anydpi-v26
│ │ │ │ ├── ic_paste.xml
│ │ │ │ ├── ic_paste_round.xml
│ │ │ │ ├── ic_launcher.xml
│ │ │ │ └── ic_launcher_round.xml
│ │ │ ├── drawable
│ │ │ │ ├── borders_red.xml
│ │ │ │ ├── ic_baseline_play_arrow_24.xml
│ │ │ │ ├── ic_baseline_home_24.xml
│ │ │ │ ├── ic_downward_24.xml
│ │ │ │ ├── ic_baseline_delete_24.xml
│ │ │ │ ├── borders_white.xml
│ │ │ │ ├── borders_edittext.xml
│ │ │ │ ├── ic_baseline_videocam_24.xml
│ │ │ │ ├── ic_gallery.xml
│ │ │ │ ├── ic_paste.xml
│ │ │ │ ├── ic_baseline_share_24.xml
│ │ │ │ ├── ic_download.xml
│ │ │ │ ├── ic_facebook.xml
│ │ │ │ ├── ic_cancel.xml
│ │ │ │ ├── ic_baseline_settings_24.xml
│ │ │ │ ├── ic_video.xml
│ │ │ │ ├── ic_comment.xml
│ │ │ │ ├── ic_like.xml
│ │ │ │ ├── ic_paste_foreground.xml
│ │ │ │ ├── ic_instagram.xml
│ │ │ │ └── ic_launcher_background.xml
│ │ │ ├── font
│ │ │ │ ├── open_sans_bold.xml
│ │ │ │ └── roboto_mono_thin.xml
│ │ │ ├── menu
│ │ │ │ └── menu.xml
│ │ │ ├── drawable-v24
│ │ │ │ └── ic_launcher_foreground.xml
│ │ │ ├── layout
│ │ │ │ ├── fragment_gallery.xml
│ │ │ │ ├── activity_main.xml
│ │ │ │ ├── fragment_home.xml
│ │ │ │ ├── gallery_image_view.xml
│ │ │ │ ├── video_view_layout.xml
│ │ │ │ └── image_view_layout.xml
│ │ │ └── raw
│ │ │ │ └── no_files.json
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── androdude
│ │ │ │ └── intugdownloder
│ │ │ │ ├── db
│ │ │ │ ├── model
│ │ │ │ │ └── Post_Class
│ │ │ │ │ │ ├── Edge.kt
│ │ │ │ │ │ ├── EdgeX.kt
│ │ │ │ │ │ ├── NodeX.kt
│ │ │ │ │ │ ├── EdgeXX.kt
│ │ │ │ │ │ ├── EdgeXXX.kt
│ │ │ │ │ │ ├── EdgeLikedBy.kt
│ │ │ │ │ │ ├── EdgeLikedByX.kt
│ │ │ │ │ │ ├── EdgeLikedByXX.kt
│ │ │ │ │ │ ├── EdgeFollowedBy.kt
│ │ │ │ │ │ ├── PostRespose.kt
│ │ │ │ │ │ ├── Graphql.kt
│ │ │ │ │ │ ├── Dimensions.kt
│ │ │ │ │ │ ├── EdgeMediaToCaption.kt
│ │ │ │ │ │ ├── EdgeRelatedProfiles.kt
│ │ │ │ │ │ ├── EdgeMediaToSponsorUser.kt
│ │ │ │ │ │ ├── EdgeMediaToTaggedUser.kt
│ │ │ │ │ │ ├── EdgeOwnerToTimelineMedia.kt
│ │ │ │ │ │ ├── EdgeMediaToHoistedComment.kt
│ │ │ │ │ │ ├── PageInfo.kt
│ │ │ │ │ │ ├── EdgeWebMediaToRelatedMedia.kt
│ │ │ │ │ │ ├── PageInfoX.kt
│ │ │ │ │ │ ├── EdgeMediaPreviewLike.kt
│ │ │ │ │ │ ├── EdgeMediaPreviewComment.kt
│ │ │ │ │ │ ├── DisplayResource.kt
│ │ │ │ │ │ ├── EdgeThreadedComments.kt
│ │ │ │ │ │ ├── Owner.kt
│ │ │ │ │ │ ├── EdgeMediaToParentComment.kt
│ │ │ │ │ │ ├── OwnerX.kt
│ │ │ │ │ │ ├── OwnerXX.kt
│ │ │ │ │ │ ├── Node.kt
│ │ │ │ │ │ ├── NodeXXX.kt
│ │ │ │ │ │ ├── NodeXX.kt
│ │ │ │ │ │ ├── OwnerXXX.kt
│ │ │ │ │ │ └── ShortcodeMedia.kt
│ │ │ │ └── Repository
│ │ │ │ │ └── Repository.kt
│ │ │ │ ├── UI
│ │ │ │ ├── Model
│ │ │ │ │ └── FileClass.kt
│ │ │ │ ├── MainActivity.kt
│ │ │ │ ├── Adapters
│ │ │ │ │ └── FilesAdapter.kt
│ │ │ │ ├── GalleryFragment.kt
│ │ │ │ ├── Utils
│ │ │ │ │ └── Utils.kt
│ │ │ │ └── HomeFragment.kt
│ │ │ │ ├── ViewModel
│ │ │ │ └── PostViewModel.kt
│ │ │ │ └── api
│ │ │ │ └── PostApiService.kt
│ │ └── AndroidManifest.xml
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── androdude
│ │ │ └── intugdownloder
│ │ │ └── ExampleUnitTest.kt
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── androdude
│ │ └── intugdownloder
│ │ └── ExampleInstrumentedTest.kt
├── proguard-rules.pro
└── build.gradle
├── .idea
├── .name
├── codeStyles
│ ├── codeStyleConfig.xml
│ └── Project.xml
├── misc.xml
├── runConfigurations.xml
├── gradle.xml
└── jarRepositories.xml
├── settings.gradle
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── gradle.properties
├── gradlew.bat
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
--------------------------------------------------------------------------------
/.idea/.name:
--------------------------------------------------------------------------------
1 | Intug Downloader
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 | rootProject.name = "Intug Downloader"
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/ic_paste-playstore.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/ic_paste-playstore.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_paste.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-hdpi/ic_paste.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_paste.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-mdpi/ic_paste.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_paste.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xhdpi/ic_paste.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_paste.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xxhdpi/ic_paste.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_paste.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_paste.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_paste_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-hdpi/ic_paste_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_paste_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-mdpi/ic_paste_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_paste_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xhdpi/ic_paste_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_paste_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xxhdpi/ic_paste_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_paste_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_paste_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Joydip1997/Intug_Downloder/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/Edge.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class Edge(
4 | val node: Node
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeX(
4 | val node: NodeX
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/NodeX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class NodeX(
4 | val text: String
5 | )
--------------------------------------------------------------------------------
/app/src/main/res/values/ic_paste_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeXX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeXX(
4 | val node: NodeXX
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeXXX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeXXX(
4 | val node: NodeXXX
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeLikedBy.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeLikedBy(
4 | val count: Int
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeLikedByX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeLikedByX(
4 | val count: Int
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeLikedByXX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeLikedByXX(
4 | val count: Int
5 | )
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeFollowedBy.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeFollowedBy(
4 | val count: Int
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/PostRespose.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class PostRespose(
4 | val graphql: Graphql
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/UI/Model/FileClass.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.UI.Model
2 |
3 |
4 | import java.io.File
5 |
6 |
7 | data class FileClass(var file : File)
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/Graphql.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class Graphql(
4 | val shortcode_media: ShortcodeMedia
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/Dimensions.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class Dimensions(
4 | val height: Int,
5 | val width: Int
6 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeMediaToCaption.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeMediaToCaption(
4 | val edges: List
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeRelatedProfiles.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeRelatedProfiles(
4 | val edges: List
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeMediaToSponsorUser.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeMediaToSponsorUser(
4 | val edges: List
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeMediaToTaggedUser.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeMediaToTaggedUser(
4 | val edges: List
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeOwnerToTimelineMedia.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeOwnerToTimelineMedia(
4 | val count: Int
5 | )
--------------------------------------------------------------------------------
/app/src/main/res/xml/provider_path.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeMediaToHoistedComment.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeMediaToHoistedComment(
4 | val edges: List
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/PageInfo.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class PageInfo(
4 | val end_cursor: Any,
5 | val has_next_page: Boolean
6 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeWebMediaToRelatedMedia.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeWebMediaToRelatedMedia(
4 | val edges: List
5 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/PageInfoX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class PageInfoX(
4 | val end_cursor: String,
5 | val has_next_page: Boolean
6 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeMediaPreviewLike.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeMediaPreviewLike(
4 | val count: Int,
5 | val edges: List
6 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeMediaPreviewComment.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeMediaPreviewComment(
4 | val count: Int,
5 | val edges: List
6 | )
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Intug Downloader
3 |
4 | Hello blank fragment
5 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/DisplayResource.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class DisplayResource(
4 | val config_height: Int,
5 | val config_width: Int,
6 | val src: String
7 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeThreadedComments.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeThreadedComments(
4 | val count: Int,
5 | val edges: List,
6 | val page_info: PageInfo
7 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/Owner.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class Owner(
4 | val id: String,
5 | val is_verified: Boolean,
6 | val profile_pic_url: String,
7 | val username: String
8 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/EdgeMediaToParentComment.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class EdgeMediaToParentComment(
4 | val count: Int,
5 | val edges: List,
6 | val page_info: PageInfoX
7 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/OwnerX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class OwnerX(
4 | val id: String,
5 | val is_verified: Boolean,
6 | val profile_pic_url: String,
7 | val username: String
8 | )
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/OwnerXX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class OwnerXX(
4 | val id: String,
5 | val is_verified: Boolean,
6 | val profile_pic_url: String,
7 | val username: String
8 | )
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 | .cxx
15 |
--------------------------------------------------------------------------------
/app/src/main/res/values/preloaded_fonts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @font/open_sans_bold
5 | - @font/roboto_mono_thin
6 |
7 |
8 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Sep 24 14:17:26 IST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_paste.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_paste_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/borders_red.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
7 |
8 |
9 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_play_arrow_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_home_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_downward_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/Node.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class Node(
4 | val created_at: Int,
5 | val did_report_as_spam: Boolean,
6 | val edge_liked_by: EdgeLikedBy,
7 | val id: String,
8 | val is_restricted_pending: Boolean,
9 | val owner: Owner,
10 | val text: String,
11 | val viewer_has_liked: Boolean
12 | )
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_delete_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/NodeXXX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class NodeXXX(
4 | val created_at: Int,
5 | val did_report_as_spam: Boolean,
6 | val edge_liked_by: EdgeLikedByXX,
7 | val id: String,
8 | val is_restricted_pending: Boolean,
9 | val owner: OwnerX,
10 | val text: String,
11 | val viewer_has_liked: Boolean
12 | )
--------------------------------------------------------------------------------
/app/src/main/res/drawable/borders_white.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
7 |
8 |
9 |
11 |
12 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/borders_edittext.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
7 |
8 |
9 |
11 |
12 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/app/src/main/res/font/open_sans_bold.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/font/roboto_mono_thin.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_videocam_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_gallery.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/NodeXX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class NodeXX(
4 | val created_at: Int,
5 | val did_report_as_spam: Boolean,
6 | val edge_liked_by: EdgeLikedByX,
7 | val edge_threaded_comments: EdgeThreadedComments,
8 | val id: String,
9 | val is_restricted_pending: Boolean,
10 | val owner: OwnerXX,
11 | val text: String,
12 | val viewer_has_liked: Boolean
13 | )
--------------------------------------------------------------------------------
/app/src/test/java/com/androdude/intugdownloder/ExampleUnitTest.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder
2 |
3 | import org.junit.Test
4 |
5 | import org.junit.Assert.*
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * See [testing documentation](http://d.android.com/tools/testing).
11 | */
12 | class ExampleUnitTest {
13 | @Test
14 | fun addition_isCorrect() {
15 | assertEquals(4, 2 + 2)
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/Repository/Repository.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.Repository
2 |
3 | import androidx.lifecycle.LiveData
4 | import com.androdude.intugdownloder.api.PostApiService
5 | import com.androdude.intugdownloder.db.model.PostRespose
6 | import retrofit2.Response
7 |
8 | class Repository {
9 |
10 | suspend fun getPosts(url : String) : Response
11 | {
12 | return PostApiService().getPostDetails(url)
13 | }
14 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #e02e4c
4 | #e02e4c
5 | #03DAC5
6 |
7 | #f23353
8 |
9 |
10 | #ffffff
11 | #000000
12 |
13 | #f23353
14 | #2b86eb
15 | #f8666f
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/ViewModel/PostViewModel.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.ViewModel
2 |
3 |
4 | import androidx.lifecycle.LiveData
5 | import androidx.lifecycle.ViewModel
6 | import androidx.lifecycle.liveData
7 | import com.androdude.intugdownloder.db.Repository.Repository
8 | import com.androdude.intugdownloder.db.model.PostRespose
9 | import retrofit2.Response
10 |
11 | class PostViewModel : ViewModel() {
12 | private var repository: Repository = Repository()
13 |
14 | fun getPosts(url : String) : LiveData> = liveData {
15 | val response = repository.getPosts(url)
16 | emit(response)
17 | }
18 | }
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_paste.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/OwnerXXX.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class OwnerXXX(
4 | val blocked_by_viewer: Boolean,
5 | val edge_followed_by: EdgeFollowedBy,
6 | val edge_owner_to_timeline_media: EdgeOwnerToTimelineMedia,
7 | val followed_by_viewer: Boolean,
8 | val full_name: String,
9 | val has_blocked_viewer: Boolean,
10 | val id: String,
11 | val is_private: Boolean,
12 | val is_unpublished: Boolean,
13 | val is_verified: Boolean,
14 | val pass_tiering_recommendation: Boolean,
15 | val profile_pic_url: String,
16 | val requested_by_viewer: Boolean,
17 | val restricted_by_viewer: Boolean,
18 | val username: String
19 | )
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_share_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/androdude/intugdownloder/ExampleInstrumentedTest.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder
2 |
3 | import androidx.test.platform.app.InstrumentationRegistry
4 | import androidx.test.ext.junit.runners.AndroidJUnit4
5 |
6 | import org.junit.Test
7 | import org.junit.runner.RunWith
8 |
9 | import org.junit.Assert.*
10 |
11 | /**
12 | * Instrumented test, which will execute on an Android device.
13 | *
14 | * See [testing documentation](http://d.android.com/tools/testing).
15 | */
16 | @RunWith(AndroidJUnit4::class)
17 | class ExampleInstrumentedTest {
18 | @Test
19 | fun useAppContext() {
20 | // Context of the app under test.
21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22 | assertEquals("com.androdude.intugdownloder", appContext.packageName)
23 | }
24 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/api/PostApiService.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.api
2 |
3 | import com.androdude.intugdownloder.db.model.PostRespose
4 | import retrofit2.Response
5 | import retrofit2.Retrofit
6 | import retrofit2.converter.gson.GsonConverterFactory
7 | import retrofit2.http.GET
8 | import retrofit2.http.Url
9 |
10 |
11 | interface PostApiService {
12 |
13 | @GET
14 | suspend fun getPostDetails(@Url url : String) : Response
15 |
16 |
17 | companion object
18 | {
19 | operator fun invoke() : PostApiService
20 | {
21 |
22 |
23 | return Retrofit.Builder()
24 | .baseUrl("https://www.instagram.com/")
25 | .addConverterFactory(GsonConverterFactory.create()).build().create(PostApiService::class.java)
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_download.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/.idea/jarRepositories.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_facebook.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_cancel.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_baseline_settings_24.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx2048m
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. More details, visit
12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app"s APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Automatically convert third-party libraries to use AndroidX
19 | android.enableJetifier=true
20 | # Kotlin code style for this project: "official" or "obsolete":
21 | kotlin.code.style=official
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
29 |
32 |
33 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/db/model/Post_Class/ShortcodeMedia.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.db.model
2 |
3 | data class ShortcodeMedia(
4 | val __typename: String,
5 | val accessibility_caption: String,
6 | val caption_is_edited: Boolean,
7 | val commenting_disabled_for_viewer: Boolean,
8 | val comments_disabled: Boolean,
9 | val dimensions: Dimensions,
10 | val display_resources: List,
11 | val display_url: String,
12 | val edge_media_preview_comment: EdgeMediaPreviewComment,
13 | val edge_media_preview_like: EdgeMediaPreviewLike,
14 | val edge_media_to_caption: EdgeMediaToCaption,
15 | val edge_media_to_hoisted_comment: EdgeMediaToHoistedComment,
16 | val edge_media_to_parent_comment: EdgeMediaToParentComment,
17 | val edge_media_to_sponsor_user: EdgeMediaToSponsorUser,
18 | val edge_media_to_tagged_user: EdgeMediaToTaggedUser,
19 | val edge_related_profiles: EdgeRelatedProfiles,
20 | val edge_web_media_to_related_media: EdgeWebMediaToRelatedMedia,
21 | val fact_check_information: Any,
22 | val fact_check_overall_rating: Any,
23 | val gating_info: Any,
24 | val has_ranked_comments: Boolean,
25 | val id: String,
26 | val is_ad: Boolean,
27 | val is_video: Boolean,
28 | val video_url : String,
29 | val location: Any,
30 | val media_overlay_info: Any,
31 | val media_preview: String,
32 | val owner: OwnerXXX,
33 | val sensitivity_friction_info: Any,
34 | val shortcode: String,
35 | val taken_at_timestamp: Int,
36 | val tracking_token: String,
37 | val viewer_can_reshare: Boolean,
38 | val viewer_has_liked: Boolean,
39 | val viewer_has_saved: Boolean,
40 | val viewer_has_saved_to_collection: Boolean,
41 | val viewer_in_photo_of_you: Boolean
42 | )
--------------------------------------------------------------------------------
/app/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
8 |
9 |
15 |
18 |
21 |
22 |
23 |
24 |
30 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/UI/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.UI
2 |
3 | import androidx.appcompat.app.AppCompatActivity
4 | import android.os.Bundle
5 | import android.util.Log
6 | import androidx.lifecycle.*
7 | import com.androdude.intugdownloder.R
8 | import com.androdude.intugdownloder.ViewModel.PostViewModel
9 | import com.androdude.intugdownloder.api.PostApiService
10 | import com.androdude.intugdownloder.db.model.PostRespose
11 | import com.ismaeldivita.chipnavigation.ChipNavigationBar
12 | import kotlinx.android.synthetic.main.activity_main.*
13 | import kotlinx.coroutines.Dispatchers
14 | import kotlinx.coroutines.GlobalScope
15 | import kotlinx.coroutines.launch
16 | import retrofit2.Response
17 |
18 | class MainActivity : AppCompatActivity() {
19 | private lateinit var respose: LiveData>
20 | private lateinit var postViewModel: PostViewModel
21 |
22 | override fun onCreate(savedInstanceState: Bundle?) {
23 | super.onCreate(savedInstanceState)
24 | setContentView(R.layout.activity_main)
25 |
26 | //set to home screen on first time open
27 | if(savedInstanceState == null)
28 | {
29 | chip_menu.setItemSelected(R.id.home_menu)
30 | supportFragmentManager.beginTransaction().replace(R.id.main_activity_layout,HomeFragment()).commit()
31 | }
32 |
33 |
34 |
35 | chip_menu.setOnItemSelectedListener(object : ChipNavigationBar.OnItemSelectedListener{
36 | override fun onItemSelected(id: Int) {
37 | when(id)
38 | {
39 | R.id.home_menu ->supportFragmentManager.beginTransaction().replace(R.id.main_activity_layout,HomeFragment()).commit()
40 | R.id.global_menu ->supportFragmentManager.beginTransaction().replace(R.id.main_activity_layout,GalleryFragment()).commit()
41 | }
42 | }
43 |
44 | })
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | }
53 | }
54 |
55 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_video.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_comment.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_gallery.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
30 |
31 |
38 |
39 |
46 |
47 |
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_like.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_paste_foreground.xml:
--------------------------------------------------------------------------------
1 |
6 |
10 |
13 |
16 |
19 |
22 |
25 |
28 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_instagram.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
19 |
23 |
24 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
50 |
51 |
52 |
53 |
64 |
65 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'kotlin-android'
3 | apply plugin: 'kotlin-android-extensions'
4 | apply plugin: 'kotlin-kapt'
5 |
6 | android {
7 | compileSdkVersion 30
8 | buildToolsVersion "30.0.2"
9 |
10 | defaultConfig {
11 | applicationId "com.androdude.intugdownloder"
12 | minSdkVersion 25
13 | targetSdkVersion 30
14 | versionCode 1
15 | versionName "1.0"
16 |
17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
18 | }
19 |
20 | buildTypes {
21 | release {
22 | minifyEnabled false
23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
24 | }
25 | }
26 |
27 | buildTypes {
28 | release {
29 | minifyEnabled false
30 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
31 | }
32 | }
33 |
34 | compileOptions {
35 | sourceCompatibility JavaVersion.VERSION_1_8
36 | targetCompatibility JavaVersion.VERSION_1_8
37 | }
38 |
39 | kotlinOptions {
40 | jvmTarget = JavaVersion.VERSION_1_8.toString()
41 | }
42 |
43 | buildFeatures {
44 | viewBinding true
45 | }
46 | }
47 |
48 | dependencies {
49 | implementation fileTree(dir: "libs", include: ["*.jar"])
50 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
51 | implementation 'androidx.core:core-ktx:1.3.1'
52 | implementation 'androidx.appcompat:appcompat:1.2.0'
53 | implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
54 | implementation 'androidx.legacy:legacy-support-v4:1.0.0'
55 | testImplementation 'junit:junit:4.12'
56 | androidTestImplementation 'androidx.test.ext:junit:1.1.2'
57 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
58 |
59 | //Material Design
60 | implementation 'com.google.android.material:material:1.2.1'
61 |
62 | //Chip Bootom Navigation
63 | implementation'com.ismaeldivita.chipnavigation:chip-navigation-bar:1.3.3'
64 |
65 | //LifeCycle
66 | implementation 'androidx.lifecycle:lifecycle-common:2.2.0'
67 | implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
68 | implementation 'android.arch.lifecycle:extensions:2.2.0'
69 | implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
70 | // Lifecycle components
71 | implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
72 | kapt "androidx.lifecycle:lifecycle-compiler:2.2.0"
73 | implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
74 |
75 |
76 |
77 | //Coroutines
78 | implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.6'
79 |
80 | //Glide
81 | implementation 'com.github.bumptech.glide:glide:4.11.0'
82 | annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
83 |
84 | //Retofit
85 | implementation 'com.squareup.retrofit2:retrofit:2.9.0'
86 | implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
87 |
88 | //Circle Imageview
89 | implementation 'de.hdodenhof:circleimageview:3.1.0'
90 |
91 | //Lottie
92 | implementation "com.airbnb.android:lottie:3.4.0"
93 |
94 |
95 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/UI/Adapters/FilesAdapter.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.UI.Adapters
2 |
3 | import android.graphics.BitmapFactory
4 | import android.view.LayoutInflater
5 | import android.view.View
6 | import android.view.ViewGroup
7 | import android.widget.ImageView
8 | import android.widget.TextView
9 | import androidx.constraintlayout.widget.ConstraintLayout
10 | import androidx.recyclerview.widget.RecyclerView
11 | import com.androdude.intugdownloder.R
12 | import com.androdude.intugdownloder.UI.Model.FileClass
13 | import com.androdude.intugdownloder.UI.Utils.Utils
14 |
15 | class FilesAdapter : RecyclerView.Adapter() {
16 |
17 | private lateinit var fileList : List
18 | private lateinit var mListener: onListItemClick
19 | interface onListItemClick
20 | {
21 | fun getListItem(pos : Int,boolean: Boolean)
22 | }
23 |
24 | fun setOnListItemClick(mObjectListener: onListItemClick)
25 | {
26 | mListener=mObjectListener
27 | }
28 |
29 | fun setImageList(mList : List)
30 | {
31 | fileList=mList
32 | notifyDataSetChanged()
33 | }
34 |
35 |
36 |
37 | inner class mImageViewHolder(itemView : View) : RecyclerView.ViewHolder(itemView)
38 | {
39 | val mImageView = itemView.findViewById(R.id.gallery_imageView)
40 | val mVideoView = itemView.findViewById(R.id.gallery_videoView)
41 | val mFileName = itemView.findViewById(R.id.gallery_file_name)
42 | val mFileCreatedDate = itemView.findViewById(R.id.gallery_created_date)
43 | val mFileDeleteButton = itemView.findViewById(R.id.file_delete)
44 |
45 | init {
46 |
47 | mFileDeleteButton.setOnClickListener {
48 | if(mListener != null && adapterPosition != RecyclerView.NO_POSITION )
49 | {
50 | mListener.getListItem(adapterPosition,true)
51 | }
52 | }
53 |
54 | itemView.setOnClickListener {
55 | if(mListener != null && adapterPosition != RecyclerView.NO_POSITION )
56 | {
57 | mListener.getListItem(adapterPosition,false)
58 | }
59 | }
60 |
61 |
62 |
63 |
64 |
65 | }
66 | }
67 |
68 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): mImageViewHolder {
69 | return mImageViewHolder(LayoutInflater.from(parent.context).inflate(R.layout.gallery_image_view,parent,false))
70 | }
71 |
72 | override fun getItemCount(): Int {
73 | return fileList.size
74 | }
75 |
76 | override fun onBindViewHolder(holder: mImageViewHolder, position: Int) {
77 | if( Utils.checkFileExtention(fileList[position].file))
78 | {
79 | holder.mImageView.visibility = View.VISIBLE
80 | holder.mImageView.setImageBitmap(BitmapFactory.decodeFile(fileList[position].file.path))
81 | }
82 | else
83 | {
84 | holder.mVideoView.visibility = View.VISIBLE
85 | }
86 | holder.mFileName.text = fileList[position].file.name
87 | holder.mFileCreatedDate.text = Utils.setConvertedTime(fileList[position].file.lastModified())
88 |
89 | }
90 |
91 |
92 |
93 | }
--------------------------------------------------------------------------------
/app/src/main/res/values/font_certs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | - @array/com_google_android_gms_fonts_certs_dev
5 | - @array/com_google_android_gms_fonts_certs_prod
6 |
7 |
8 | -
9 | MIIEqDCCA5CgAwIBAgIJANWFuGx90071MA0GCSqGSIb3DQEBBAUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTAeFw0wODA0MTUyMzM2NTZaFw0zNTA5MDEyMzM2NTZaMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbTCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBANbOLggKv+IxTdGNs8/TGFy0PTP6DHThvbbR24kT9ixcOd9W+EaBPWW+wPPKQmsHxajtWjmQwWfna8mZuSeJS48LIgAZlKkpFeVyxW0qMBujb8X8ETrWy550NaFtI6t9+u7hZeTfHwqNvacKhp1RbE6dBRGWynwMVX8XW8N1+UjFaq6GCJukT4qmpN2afb8sCjUigq0GuMwYXrFVee74bQgLHWGJwPmvmLHC69EH6kWr22ijx4OKXlSIx2xT1AsSHee70w5iDBiK4aph27yH3TxkXy9V89TDdexAcKk/cVHYNnDBapcavl7y0RiQ4biu8ymM8Ga/nmzhRKya6G0cGw8CAQOjgfwwgfkwHQYDVR0OBBYEFI0cxb6VTEM8YYY6FbBMvAPyT+CyMIHJBgNVHSMEgcEwgb6AFI0cxb6VTEM8YYY6FbBMvAPyT+CyoYGapIGXMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHQW5kcm9pZDEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEiMCAGCSqGSIb3DQEJARYTYW5kcm9pZEBhbmRyb2lkLmNvbYIJANWFuGx90071MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADggEBABnTDPEF+3iSP0wNfdIjIz1AlnrPzgAIHVvXxunW7SBrDhEglQZBbKJEk5kT0mtKoOD1JMrSu1xuTKEBahWRbqHsXclaXjoBADb0kkjVEJu/Lh5hgYZnOjvlba8Ld7HCKePCVePoTJBdI4fvugnL8TsgK05aIskyY0hKI9L8KfqfGTl1lzOv2KoWD0KWwtAWPoGChZxmQ+nBli+gwYMzM1vAkP+aayLe0a1EQimlOalO762r0GXO0ks+UeXde2Z4e+8S/pf7pITEI/tP+MxJTALw9QUWEv9lKTk+jkbqxbsh8nfBUapfKqYn0eidpwq2AzVp3juYl7//fKnaPhJD9gs=
10 |
11 |
12 |
13 | -
14 | MIIEQzCCAyugAwIBAgIJAMLgh0ZkSjCNMA0GCSqGSIb3DQEBBAUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASAwDQYJKoZIhvcNAQEBBQADggENADCCAQgCggEBAKtWLgDYO6IIrgqWbxJOKdoR8qtW0I9Y4sypEwPpt1TTcvZApxsdyxMJZ2JORland2qSGT2y5b+3JKkedxiLDmpHpDsz2WCbdxgxRczfey5YZnTJ4VZbH0xqWVW/8lGmPav5xVwnIiJS6HXk+BVKZF+JcWjAsb/GEuq/eFdpuzSqeYTcfi6idkyugwfYwXFU1+5fZKUaRKYCwkkFQVfcAs1fXA5V+++FGfvjJ/CxURaSxaBvGdGDhfXE28LWuT9ozCl5xw4Yq5OGazvV24mZVSoOO0yZ31j7kYvtwYK6NeADwbSxDdJEqO4k//0zOHKrUiGYXtqw/A0LFFtqoZKFjnkCAQOjgdkwgdYwHQYDVR0OBBYEFMd9jMIhF1Ylmn/Tgt9r45jk14alMIGmBgNVHSMEgZ4wgZuAFMd9jMIhF1Ylmn/Tgt9r45jk14aloXikdjB0MQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xEDAOBgNVBAsTB0FuZHJvaWQxEDAOBgNVBAMTB0FuZHJvaWSCCQDC4IdGZEowjTAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBAUAA4IBAQBt0lLO74UwLDYKqs6Tm8/yzKkEu116FmH4rkaymUIE0P9KaMftGlMexFlaYjzmB2OxZyl6euNXEsQH8gjwyxCUKRJNexBiGcCEyj6z+a1fuHHvkiaai+KL8W1EyNmgjmyy8AW7P+LLlkR+ho5zEHatRbM/YAnqGcFh5iZBqpknHf1SKMXFh4dd239FJ1jWYfbMDMy3NS5CTMQ2XFI1MvcyUTdZPErjQfTbQe3aDQsQcafEQPD+nqActifKZ0Np0IS9L9kR/wbNvyz6ENwPiTrjV2KRkEjH78ZMcUQXg0L3BYHJ3lc69Vs5Ddf9uUGGMYldX3WfMBEmh/9iFBDAaTCK
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.idea/codeStyles/Project.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 | xmlns:android
17 |
18 | ^$
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 | xmlns:.*
28 |
29 | ^$
30 |
31 |
32 | BY_NAME
33 |
34 |
35 |
36 |
37 |
38 |
39 | .*:id
40 |
41 | http://schemas.android.com/apk/res/android
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | .*:name
51 |
52 | http://schemas.android.com/apk/res/android
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | name
62 |
63 | ^$
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | style
73 |
74 | ^$
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | .*
84 |
85 | ^$
86 |
87 |
88 | BY_NAME
89 |
90 |
91 |
92 |
93 |
94 |
95 | .*
96 |
97 | http://schemas.android.com/apk/res/android
98 |
99 |
100 | ANDROID_ATTRIBUTE_ORDER
101 |
102 |
103 |
104 |
105 |
106 |
107 | .*
108 |
109 | .*
110 |
111 |
112 | BY_NAME
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/fragment_home.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
20 |
21 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
42 |
43 |
50 |
51 |
54 |
59 |
60 |
61 |
67 |
68 |
69 |
72 |
73 |
89 |
90 |
99 |
100 |
101 |
102 |
103 |
114 |
115 |
116 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/gallery_image_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
21 |
22 |
27 |
28 |
33 |
34 |
44 |
45 |
55 |
56 |
65 |
66 |
67 |
68 |
69 |
74 |
75 |
76 |
86 |
87 |
97 |
98 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/UI/GalleryFragment.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.UI
2 |
3 | import android.content.DialogInterface
4 | import android.content.Intent
5 | import android.net.Uri
6 | import android.os.Bundle
7 | import android.os.Environment
8 | import android.os.StrictMode
9 | import android.os.StrictMode.VmPolicy
10 | import android.util.Log
11 | import android.view.View
12 | import androidx.appcompat.app.AlertDialog
13 | import androidx.fragment.app.Fragment
14 | import androidx.recyclerview.widget.LinearLayoutManager
15 | import com.androdude.intugdownloder.R
16 | import com.androdude.intugdownloder.UI.Adapters.FilesAdapter
17 | import com.androdude.intugdownloder.UI.Model.FileClass
18 | import com.androdude.intugdownloder.UI.Utils.Utils
19 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
20 | import kotlinx.android.synthetic.main.activity_main.*
21 | import kotlinx.android.synthetic.main.fragment_gallery.view.*
22 | import java.io.File
23 |
24 |
25 | class GalleryFragment : Fragment(R.layout.fragment_gallery) {
26 |
27 | private lateinit var mAlertDialog: AlertDialog
28 | private lateinit var mList : ArrayList
29 | private lateinit var mAdapter: FilesAdapter
30 |
31 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
32 | super.onViewCreated(view, savedInstanceState)
33 |
34 | requireActivity().toolbar_title.text="Downloads"
35 |
36 | //To access gallery in the phone
37 | val builder = VmPolicy.Builder()
38 | StrictMode.setVmPolicy(builder.build())
39 | builder.detectFileUriExposure()
40 |
41 | mList = ArrayList()
42 | mAdapter= FilesAdapter()
43 | mAdapter.setImageList(mList)
44 | getFiles(view)
45 | view.gallery_view.adapter=mAdapter
46 | view.gallery_view.layoutManager = LinearLayoutManager(requireContext())
47 | fileDelete(view)
48 | }
49 |
50 | //get the images and videos from the download folder
51 | fun getFiles(view: View)
52 | {
53 | val path: String =
54 | Environment.getExternalStorageDirectory().toString().toString() + "/intug"
55 | Log.d("Files", "Path: $path")
56 | val directory = File(path)
57 | val files: Array? = directory.listFiles()
58 | Log.d("Files", "Size: " + files?.size)
59 | val x = files.isNullOrEmpty()
60 |
61 | if(files.isNullOrEmpty())
62 | {
63 | view.no_files_animation_view.visibility=View.VISIBLE
64 | view.gallery_view.visibility=View.INVISIBLE
65 | }
66 | else
67 | {
68 | for (i in files.indices) {
69 | mList.add(FileClass(files[i]))
70 | }
71 | view.no_files_animation_view.visibility=View.INVISIBLE
72 | view.gallery_view.visibility=View.VISIBLE
73 |
74 | }
75 | }
76 |
77 | //Delete the file function
78 | fun fileDelete(view: View)
79 | {
80 | mAdapter.setOnListItemClick(object : FilesAdapter.onListItemClick
81 | {
82 |
83 |
84 | override fun getListItem(pos: Int, boolean: Boolean) {
85 | val listFileItem = mList[pos]
86 | if(boolean)
87 | {
88 | wantToDelete(pos,view)
89 | }
90 | else
91 | {
92 | showFile(listFileItem.file)
93 | }
94 | }
95 |
96 |
97 | })
98 | }
99 |
100 | //show the images/videos in gallery
101 | private fun showFile(file: File) {
102 | val intent = Intent(Intent.ACTION_VIEW)
103 | if(Utils.checkFileExtention(file))
104 | {
105 | intent.setDataAndType( Uri.fromFile(file)
106 | , "image/*")
107 | }
108 | else
109 | {
110 | intent.setDataAndType( Uri.fromFile(file)
111 | , "video/*")
112 | }
113 |
114 | intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
115 | intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
116 | startActivity(intent)
117 | }
118 |
119 |
120 | //Want to delete dialog
121 | private fun wantToDelete(pos : Int,view: View)
122 | {
123 | val mAlertDialogBuilder = MaterialAlertDialogBuilder(requireContext())
124 | mAlertDialogBuilder.setTitle("Hey!")
125 | mAlertDialogBuilder.setMessage("Do you want to delete the file?")
126 | mAlertDialogBuilder.setPositiveButton("Delete",object : DialogInterface.OnClickListener{
127 | override fun onClick(dialog: DialogInterface?, which: Int) {
128 | val selectedFile = mList[pos].file
129 | mList.removeAt(pos)
130 | mAdapter.setImageList(mList)
131 | selectedFile.delete()
132 | if(mList.isEmpty())
133 | {
134 | view.no_files_animation_view.visibility=View.VISIBLE
135 | view.gallery_view.visibility=View.INVISIBLE
136 | }
137 | else
138 | {
139 | view.no_files_animation_view.visibility=View.INVISIBLE
140 | view.gallery_view.visibility=View.VISIBLE
141 | }
142 | }
143 |
144 | })
145 | mAlertDialogBuilder.setNegativeButton("Cancel",object : DialogInterface.OnClickListener{
146 | override fun onClick(dialog: DialogInterface?, which: Int) {
147 | mAlertDialog.dismiss()
148 | }
149 |
150 | })
151 | mAlertDialog = mAlertDialogBuilder.create()
152 | mAlertDialog.show()
153 | }
154 |
155 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/UI/Utils/Utils.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.UI.Utils
2 |
3 | import android.app.DownloadManager
4 | import android.content.Context
5 | import android.net.Uri
6 | import android.os.Environment
7 | import android.webkit.MimeTypeMap
8 | import android.widget.Toast
9 | import java.io.File
10 | import java.util.*
11 | import java.util.concurrent.TimeUnit
12 |
13 |
14 | class Utils {
15 |
16 | companion object {
17 | //check the correct url
18 | fun checkLink(url: String): Boolean {
19 | return url.contains("https://www.instagram.com") and (url.startsWith("https://") or url.startsWith(
20 | "http://"
21 | ))
22 | }
23 |
24 | fun getThePostId(url: String): String {
25 | try {
26 | val x = url.split("/".toRegex()).toTypedArray()
27 | val url = "https://www.instagram.com/p/" + x[4] + "/?__a=1"
28 | return url
29 | } catch (e: Exception) {
30 |
31 | return "There is a error.Please try again later"
32 | }
33 |
34 | }
35 |
36 | //Redundant function to download file
37 | fun downloadVideo(url: String,context : Context,isVideo : Boolean) {
38 | val fileName : String
39 | if(isVideo)
40 | {
41 | fileName = "video" + System.currentTimeMillis().toString() + ".mp4"
42 | }
43 | else
44 | {
45 | fileName = "video" + System.currentTimeMillis().toString() + ".png"
46 | }
47 | val request = DownloadManager.Request(Uri.parse(url))
48 | request.setAllowedNetworkTypes(DownloadManager.Request.NETWORK_WIFI or DownloadManager.Request.NETWORK_MOBILE)
49 | request.setTitle(fileName)
50 | request.setDescription("Please Wait....")
51 | request.allowScanningByMediaScanner()
52 | request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
53 | request.setDestinationInExternalPublicDir(
54 | Environment.DIRECTORY_DOWNLOADS
55 | , fileName
56 | )
57 |
58 | val manager = context.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
59 | manager.enqueue(request)
60 | }
61 |
62 | //helper function to download the image and video
63 | fun downloadFile(baseActivity:Context,url: String?,title: String?,isVideo : Boolean): Long {
64 | val direct = File(Environment.getExternalStorageDirectory().toString() + "/Intug")
65 | direct.mkdirs()
66 | val extension : String
67 | val fileType : String
68 | if(isVideo==false)
69 | {
70 | extension = ".png"
71 | fileType="intugimage"
72 | }
73 | else
74 | {
75 | extension = ".mp4"
76 | fileType="intugvideo"
77 | }
78 | val downloadReference: Long
79 | var dm: DownloadManager
80 | dm= baseActivity.getSystemService(Context.DOWNLOAD_SERVICE) as DownloadManager
81 | val uri = Uri.parse(url)
82 | val request = DownloadManager.Request(uri)
83 | request.setDestinationInExternalPublicDir(
84 | "/Intug",
85 | fileType + System.currentTimeMillis() + extension
86 | )
87 | request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
88 | request.setTitle(title)
89 | Toast.makeText(baseActivity, "start Downloading..", Toast.LENGTH_SHORT).show()
90 |
91 | downloadReference = dm?.enqueue(request) ?: 0
92 |
93 | return downloadReference
94 |
95 |
96 |
97 | }
98 |
99 |
100 | //Helper Function to convert the created time in manageable format
101 | fun setConvertedTime(duration : Long) : String
102 | {
103 | val now = Date()
104 |
105 | val secs = Integer.parseInt(TimeUnit.MILLISECONDS.toSeconds(now.time - duration).toString())
106 | val mins = Integer.parseInt(TimeUnit.MILLISECONDS.toMinutes(now.time - duration).toString())
107 | val hours = Integer.parseInt(TimeUnit.MILLISECONDS.toHours(now.time - duration).toString())
108 | val days = Integer.parseInt(TimeUnit.MILLISECONDS.toDays(now.time - duration).toString())
109 |
110 | if(secs < 60)
111 | {
112 | return "just now"
113 | }
114 | else if(mins == 1)
115 | {
116 | return "a minute ago"
117 | }
118 | else if (mins > 1 && mins < 60)
119 | {
120 | return mins.toString() + " minutes ago"
121 | }
122 | else if(hours == 1)
123 | {
124 | return "an hour ago"
125 | }
126 | else if(hours > 1 && hours < 24)
127 | {
128 | return hours.toString() + " hours ago"
129 | }
130 | else if( days == 1)
131 | {
132 | return "1 day ago"
133 | }
134 | else
135 | {
136 | return days.toString() + " days ago"
137 | }
138 |
139 | }
140 |
141 | fun checkFileExtention(file : File) : Boolean
142 | {
143 | val file = Uri.fromFile(File(file.path))
144 | val fileExt = MimeTypeMap.getFileExtensionFromUrl(file.toString())
145 | return fileExt == "png"
146 |
147 | }
148 |
149 |
150 |
151 | }
152 |
153 |
154 |
155 | }
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Attempt to set APP_HOME
10 | # Resolve links: $0 may be a link
11 | PRG="$0"
12 | # Need this for relative symlinks.
13 | while [ -h "$PRG" ] ; do
14 | ls=`ls -ld "$PRG"`
15 | link=`expr "$ls" : '.*-> \(.*\)$'`
16 | if expr "$link" : '/.*' > /dev/null; then
17 | PRG="$link"
18 | else
19 | PRG=`dirname "$PRG"`"/$link"
20 | fi
21 | done
22 | SAVED="`pwd`"
23 | cd "`dirname \"$PRG\"`/" >/dev/null
24 | APP_HOME="`pwd -P`"
25 | cd "$SAVED" >/dev/null
26 |
27 | APP_NAME="Gradle"
28 | APP_BASE_NAME=`basename "$0"`
29 |
30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
31 | DEFAULT_JVM_OPTS=""
32 |
33 | # Use the maximum available, or set MAX_FD != -1 to use that value.
34 | MAX_FD="maximum"
35 |
36 | warn () {
37 | echo "$*"
38 | }
39 |
40 | die () {
41 | echo
42 | echo "$*"
43 | echo
44 | exit 1
45 | }
46 |
47 | # OS specific support (must be 'true' or 'false').
48 | cygwin=false
49 | msys=false
50 | darwin=false
51 | nonstop=false
52 | case "`uname`" in
53 | CYGWIN* )
54 | cygwin=true
55 | ;;
56 | Darwin* )
57 | darwin=true
58 | ;;
59 | MINGW* )
60 | msys=true
61 | ;;
62 | NONSTOP* )
63 | nonstop=true
64 | ;;
65 | esac
66 |
67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
68 |
69 | # Determine the Java command to use to start the JVM.
70 | if [ -n "$JAVA_HOME" ] ; then
71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
72 | # IBM's JDK on AIX uses strange locations for the executables
73 | JAVACMD="$JAVA_HOME/jre/sh/java"
74 | else
75 | JAVACMD="$JAVA_HOME/bin/java"
76 | fi
77 | if [ ! -x "$JAVACMD" ] ; then
78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
79 |
80 | Please set the JAVA_HOME variable in your environment to match the
81 | location of your Java installation."
82 | fi
83 | else
84 | JAVACMD="java"
85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
86 |
87 | Please set the JAVA_HOME variable in your environment to match the
88 | location of your Java installation."
89 | fi
90 |
91 | # Increase the maximum file descriptors if we can.
92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
93 | MAX_FD_LIMIT=`ulimit -H -n`
94 | if [ $? -eq 0 ] ; then
95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
96 | MAX_FD="$MAX_FD_LIMIT"
97 | fi
98 | ulimit -n $MAX_FD
99 | if [ $? -ne 0 ] ; then
100 | warn "Could not set maximum file descriptor limit: $MAX_FD"
101 | fi
102 | else
103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
104 | fi
105 | fi
106 |
107 | # For Darwin, add options to specify how the application appears in the dock
108 | if $darwin; then
109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
110 | fi
111 |
112 | # For Cygwin, switch paths to Windows format before running java
113 | if $cygwin ; then
114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
116 | JAVACMD=`cygpath --unix "$JAVACMD"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Escape application args
158 | save () {
159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
160 | echo " "
161 | }
162 | APP_ARGS=$(save "$@")
163 |
164 | # Collect all arguments for the java command, following the shell quoting and substitution rules
165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
166 |
167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
169 | cd "$(dirname "$0")"
170 | fi
171 |
172 | exec "$JAVACMD" "$@"
173 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
15 |
20 |
25 |
30 |
35 |
40 |
45 |
50 |
55 |
60 |
65 |
70 |
75 |
80 |
85 |
90 |
95 |
100 |
105 |
110 |
115 |
120 |
125 |
130 |
135 |
140 |
145 |
150 |
155 |
160 |
165 |
170 |
171 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/video_view_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
18 |
24 |
25 |
32 |
37 |
38 |
39 |
43 |
44 |
52 |
53 |
63 |
64 |
65 |
66 |
67 |
68 |
72 |
73 |
83 |
84 |
94 |
95 |
103 |
104 |
113 |
114 |
120 |
121 |
130 |
131 |
132 |
133 |
134 |
141 |
142 |
149 |
150 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/image_view_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
16 |
17 |
18 |
24 |
25 |
31 |
36 |
37 |
38 |
39 |
43 |
44 |
52 |
53 |
63 |
64 |
65 |
66 |
70 |
71 |
81 |
82 |
93 |
94 |
95 |
103 |
104 |
113 |
114 |
120 |
121 |
131 |
132 |
133 |
134 |
135 |
143 |
144 |
151 |
152 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/no_files.json:
--------------------------------------------------------------------------------
1 | {"v":"5.1.20","fr":29.9700012207031,"ip":0,"op":30.0000012219251,"w":800,"h":800,"nm":"Comp 2","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Layer 4 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":1,"k":[{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":0,"s":[413.839,379.903,0],"e":[357.339,445.403,0],"to":[5,17.3333339691162,0],"ti":[41.2394905090332,-20.968204498291,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":7,"s":[357.339,445.403,0],"e":[301.339,409.403,0],"to":[-36.0914993286133,18.3507118225098,0],"ti":[1,18.8333339691162,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":13,"s":[301.339,409.403,0],"e":[327.339,359.403,0],"to":[-0.80490493774414,-15.1590423583984,0],"ti":[-9.77583026885986,8.74895763397217,0]},{"i":{"x":0.833,"y":0.833},"o":{"x":0.167,"y":0.167},"n":"0p833_0p833_0p167_0p167","t":20,"s":[327.339,359.403,0],"e":[413.339,379.903,0],"to":[39.6666679382324,-35.5,0],"ti":[-3.5,-38,0]},{"t":30.0000012219251}],"ix":2},"a":{"a":0,"k":[227.911,252.653,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[77.568,0],[0,77.568],[-77.568,0],[0,-77.568]],"o":[[-77.568,0],[0,-77.568],[77.568,0],[0,77.568]],"v":[[62.161,53.546],[-78.288,-86.903],[62.161,-227.352],[202.609,-86.903]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[91.403,0],[0,-91.404],[-28.849,-29.787],[0,0],[0,0],[0,0],[-31.739,0],[0,91.403]],"o":[[-91.403,0],[0,44.742],[0,0],[0,0],[0,0],[25.188,15.491],[91.403,0],[0,-91.404]],"v":[[62.161,-252.403],[-103.339,-86.903],[-56.729,28.215],[-227.661,225.267],[-196.377,252.403],[-24.415,54.164],[62.161,78.597],[227.661,-86.903]],"c":true},"ix":2},"nm":"Path 2","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.033064206441,0.643001541437,0.843137254902,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[227.911,252.653],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":4,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":899.000036617021,"st":0,"bm":0}]}],"layers":[{"ddd":0,"ind":1,"ty":0,"nm":"if_docx_199244","refId":"comp_0","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[290,492,0],"ix":2},"a":{"a":0,"k":[400,400,0],"ix":1},"s":{"a":0,"k":[66,66,100],"ix":6}},"ao":0,"w":800,"h":800,"ip":0,"op":30.0000012219251,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"File Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[398.5,561.5,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0],[0,0]],"v":[[-76.039,-65.535],[-120.117,-65.535],[-120.117,21.289],[-109.945,21.289],[-109.945,-17.158],[-78.582,-17.158],[-78.582,-26.301],[-109.945,-26.301],[-109.945,-56.332],[-76.039,-56.332]],"c":true},"ix":2},"nm":"F","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.921568986481,0.921568986481,0.921568986481,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"F","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[-1.271,1.252],[0,1.777],[1.271,1.232],[1.816,0],[1.251,-1.231],[0,-1.856],[-1.252,-1.211],[-1.777,0]],"o":[[1.271,-1.251],[0,-1.856],[-1.271,-1.231],[-1.777,0],[-1.252,1.232],[0,1.857],[1.251,1.211],[1.816,0]],"v":[[-51.185,-58.33],[-49.277,-62.871],[-51.185,-67.503],[-55.816,-69.35],[-60.357,-67.503],[-62.234,-62.871],[-60.357,-58.27],[-55.816,-56.453]],"c":true},"ix":2},"nm":"i","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[-50.973,-40.711],[-60.902,-40.711],[-60.902,21.289],[-50.973,21.289]],"c":true},"ix":2},"nm":"i","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.921568986481,0.921568986481,0.921568986481,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"i","np":5,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0],[0,0]],"v":[[-20.941,-70.5],[-30.871,-70.5],[-30.871,21.289],[-20.941,21.289]],"c":true},"ix":2},"nm":"l","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.921568986481,0.921568986481,0.921568986481,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"l","np":3,"cix":2,"ix":3,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[4.44,5.248],[8.113,0],[5.469,-6.075],[0,-9.647],[-5.006,-5.631],[-8.759,0],[-5.449,3.956],[0,0],[6.983,0],[3.551,3.754],[0.161,6.902],[0,0]],"o":[[0,-9.324],[-4.441,-5.247],[-8.113,0],[-5.47,6.076],[0,10.213],[5.005,5.631],[8.961,0],[0,0],[-5.853,4.602],[-6.216,0],[-3.552,-3.754],[0,0],[0,0]],"v":[[48.99,-12.436],[42.33,-34.293],[23.5,-42.164],[3.126,-33.052],[-5.078,-9.469],[2.43,14.296],[23.076,22.742],[44.691,16.809],[44.691,7.484],[25.438,14.387],[10.785,8.756],[5.215,-7.229],[48.99,-7.229]],"c":true},"ix":2},"nm":"e","mn":"ADBE Vector Shape - Group","hd":false},{"ind":1,"ty":"sh","ix":2,"ks":{"a":0,"k":{"i":[[0,0],[-3.27,3.351],[-4.683,0],[-2.725,-3.188],[-0.041,-5.731]],"o":[[0.766,-5.409],[3.27,-3.35],[4.844,0],[2.725,3.189],[0,0]],"v":[[5.336,-15.645],[11.391,-28.783],[23.318,-33.809],[34.671,-29.025],[38.818,-15.645]],"c":true},"ix":2},"nm":"e","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"mm","mm":1,"nm":"Merge Paths 1","mn":"ADBE Vector Filter - Merge","hd":false},{"ty":"fl","c":{"a":0,"k":[0.921568986481,0.921568986481,0.921568986481,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"e","np":5,"cix":2,"ix":4,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":899.000036617021,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"Untitled-3 Outlines","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2},"a":{"a":0,"k":[400,400,0],"ix":1},"s":{"a":0,"k":[63.626,63.626,100],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0],[0,17.275]],"o":[[0,0],[0,0],[-17.275,0],[0,0]],"v":[[-117.117,-117.118],[117.117,117.118],[-85.824,117.118],[-117.117,85.825]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.322000002394,0.322000002394,0.322000002394,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[552.552,148.368],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 1","np":2,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,17.275],[0,0],[-17.275,0],[0,0],[0,0],[0,0],[17.276,0],[0,0]],"o":[[0,0],[0,-17.276],[0,0],[0,0],[0,0],[0,17.275],[0,0],[-17.275,0]],"v":[[-269.545,337.582],[-269.545,-337.582],[-238.253,-368.875],[35.309,-368.875],[269.545,-134.639],[269.545,337.582],[238.252,368.875],[-238.253,368.875]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"fl","c":{"a":0,"k":[0.169000004787,0.169000004787,0.169000004787,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[400.125,400.125],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Group 2","np":2,"cix":2,"ix":2,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":899.000036617021,"st":0,"bm":0},{"ddd":0,"ind":4,"ty":1,"nm":"White Solid 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[400,400,0],"ix":2},"a":{"a":0,"k":[400,400,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6}},"ao":0,"sw":800,"sh":800,"sc":"#ffffff","ip":0,"op":899.000036617021,"st":0,"bm":0}],"markers":[]}
--------------------------------------------------------------------------------
/app/src/main/java/com/androdude/intugdownloder/UI/HomeFragment.kt:
--------------------------------------------------------------------------------
1 | package com.androdude.intugdownloder.UI
2 |
3 | import android.content.*
4 | import android.content.ClipDescription.MIMETYPE_TEXT_PLAIN
5 | import android.content.pm.PackageManager
6 | import android.net.ConnectivityManager
7 | import android.net.Uri
8 | import android.os.Bundle
9 | import android.view.View
10 | import androidx.core.app.ActivityCompat
11 | import androidx.fragment.app.Fragment
12 | import androidx.lifecycle.LiveData
13 | import androidx.lifecycle.Observer
14 | import androidx.lifecycle.ViewModelProviders
15 | import com.androdude.intugdownloder.R
16 | import com.androdude.intugdownloder.UI.Utils.Utils
17 | import com.androdude.intugdownloder.ViewModel.PostViewModel
18 | import com.androdude.intugdownloder.db.model.PostRespose
19 | import com.bumptech.glide.Glide
20 | import com.google.android.material.dialog.MaterialAlertDialogBuilder
21 | import com.google.android.material.snackbar.Snackbar
22 | import kotlinx.android.synthetic.main.activity_main.*
23 | import kotlinx.android.synthetic.main.fragment_home.*
24 | import kotlinx.android.synthetic.main.fragment_home.view.*
25 | import kotlinx.android.synthetic.main.image_view_layout.view.*
26 | import kotlinx.android.synthetic.main.image_view_layout.view.close_dialog
27 | import kotlinx.android.synthetic.main.video_view_layout.view.*
28 | import retrofit2.Response
29 |
30 |
31 | class HomeFragment : Fragment(R.layout.fragment_home) {
32 | private lateinit var PostRespose: LiveData>
33 | private lateinit var postViewModel: PostViewModel
34 |
35 |
36 | //Permissions
37 | private val permissions = arrayOf(
38 | android.Manifest.permission.READ_EXTERNAL_STORAGE,
39 | android.Manifest.permission.WRITE_EXTERNAL_STORAGE
40 | )
41 |
42 |
43 | override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
44 | super.onViewCreated(view, savedInstanceState)
45 |
46 | requireActivity().toolbar_title.text = "Intug Downloader"
47 |
48 | postViewModel = ViewModelProviders.of(requireActivity()).get(PostViewModel::class.java)
49 |
50 | view.paste_url.setOnClickListener {
51 | pasteCopiedUrl(view)
52 | }
53 |
54 | view.open_instagram.setOnClickListener {
55 | openInstagram()
56 | }
57 |
58 |
59 |
60 | view.open_url.setOnClickListener {
61 | if (isNetworkConnected()) {
62 | val postUrl = url_edittext.text.toString()
63 | if (checkPermissions()) {
64 | if (Utils.checkLink(postUrl) && !postUrl.isEmpty()) {
65 | view.main_screen_progress_bar.visibility = View.VISIBLE
66 | view.home_screen_view.visibility = View.GONE
67 | try {
68 | PostRespose = postViewModel.getPosts(Utils.getThePostId(postUrl))
69 | PostRespose.observe(requireActivity(), Observer {
70 | val respose = it.body()
71 | view.main_screen_progress_bar.visibility = View.GONE
72 | view.home_screen_view.visibility = View.VISIBLE
73 | if (respose != null) {
74 | if (respose.graphql.shortcode_media.is_video) {
75 | getPostVideoView(respose)
76 | } else {
77 | getPostImageView(respose)
78 | }
79 | }
80 | else
81 | {
82 | Snackbar.make(view, "Error: Please Try Again", Snackbar.LENGTH_SHORT)
83 | .show()
84 | }
85 |
86 | })
87 | } catch (e: Exception) {
88 | view.main_screen_progress_bar.visibility = View.GONE
89 | view.home_screen_view.visibility = View.VISIBLE
90 | Snackbar.make(view, "Error: Please Try Again", Snackbar.LENGTH_SHORT)
91 | .show()
92 | }
93 | }
94 | }
95 | } else {
96 | Snackbar.make(view, "Error: No Internet Connection", Snackbar.LENGTH_SHORT).show()
97 | }
98 |
99 |
100 | }
101 |
102 |
103 | }
104 |
105 | //Paste the copied text
106 | private fun pasteCopiedUrl(view: View) {
107 | val clipboard =
108 | activity!!.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
109 | var pasteData = ""
110 | if (!clipboard.hasPrimaryClip()) {
111 | } else if (!clipboard.getPrimaryClipDescription()!!.hasMimeType(MIMETYPE_TEXT_PLAIN)
112 | ) {
113 |
114 | } else {
115 | val item: ClipData.Item = clipboard.getPrimaryClip()!!.getItemAt(0)
116 | pasteData = item.text.toString()
117 | url_edittext.setText(pasteData)
118 | }
119 |
120 | }
121 |
122 | //Checking Internet Connection
123 | private fun isNetworkConnected(): Boolean {
124 | val cm =
125 | requireActivity().getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager?
126 | return cm!!.activeNetworkInfo != null && cm.activeNetworkInfo!!.isConnected
127 | }
128 |
129 | private fun getPostVideoView(respose: PostRespose) {
130 | val mAlertDialogBuilder = MaterialAlertDialogBuilder(requireContext())
131 | mAlertDialogBuilder.setCancelable(false)
132 | val mView = layoutInflater.inflate(R.layout.video_view_layout, null, false)
133 | mView.post_video.setVideoPath(respose.graphql.shortcode_media.video_url)
134 | Glide.with(requireActivity()).load(respose.graphql.shortcode_media.owner.profile_pic_url)
135 | .into(mView.video_user_profile_image)
136 | mView.video_user_name.text = respose.graphql.shortcode_media.owner.username
137 | mView.video_likes_count.text =
138 | respose.graphql.shortcode_media.edge_media_preview_like.count.toString()
139 | mView.video_comments_count.text =
140 | respose.graphql.shortcode_media.edge_media_preview_comment.count.toString()
141 | val mAlertDialog = mAlertDialogBuilder.create()
142 | var is_Playing = false
143 | mView.post_video.setOnClickListener {
144 | if (is_Playing) {
145 | mView.post_video.stopPlayback()
146 | is_Playing = false
147 | } else {
148 | mView.post_video.start()
149 | is_Playing = true
150 | }
151 | }
152 | mView.close_dialog.setOnClickListener {
153 | mAlertDialog.dismiss()
154 | }
155 | mView.video_download_bttn.setOnClickListener {
156 |
157 | Utils.downloadFile(
158 | requireActivity(),
159 | respose.graphql.shortcode_media.video_url,
160 | "Intug",
161 | respose.graphql.shortcode_media.is_video
162 | )
163 | }
164 | mAlertDialog.setView(mView)
165 | mAlertDialog.show()
166 | }
167 |
168 |
169 | private fun getPostImageView(respose: PostRespose?) {
170 | val mAlertDialogBuilder = MaterialAlertDialogBuilder(requireContext())
171 | mAlertDialogBuilder.setCancelable(false)
172 | val mView = layoutInflater.inflate(R.layout.image_view_layout, null, false)
173 | Glide.with(requireActivity()).load(respose!!.graphql.shortcode_media.display_url)
174 | .into(mView.post_image)
175 | Glide.with(requireActivity()).load(respose.graphql.shortcode_media.owner.profile_pic_url)
176 | .into(mView.user_profile_image)
177 | mView.user_name.text = respose.graphql.shortcode_media.owner.username
178 | mView.likes_count.text =
179 | respose.graphql.shortcode_media.edge_media_preview_like.count.toString()
180 | mView.comments_count.text =
181 | respose.graphql.shortcode_media.edge_media_preview_comment.count.toString()
182 | val mAlertDialog = mAlertDialogBuilder.create()
183 | mView.close_dialog.setOnClickListener {
184 | mAlertDialog.dismiss()
185 | }
186 | mView.image_download_bttn.setOnClickListener {
187 |
188 | Utils.downloadFile(
189 | requireActivity(),
190 | respose.graphql.shortcode_media.display_url,
191 | "Intug",
192 | respose.graphql.shortcode_media.is_video
193 | )
194 |
195 |
196 | }
197 | mAlertDialog.setView(mView)
198 | mAlertDialog.show()
199 |
200 | }
201 |
202 | //Asking Runtime Permissions
203 | private fun checkPermissions(): Boolean {
204 | if (ActivityCompat.checkSelfPermission(
205 | requireActivity(),
206 | android.Manifest.permission.READ_EXTERNAL_STORAGE
207 | ) == PackageManager.PERMISSION_GRANTED
208 | && ActivityCompat.checkSelfPermission(
209 | requireActivity(),
210 | android.Manifest.permission.WRITE_EXTERNAL_STORAGE
211 | ) == PackageManager.PERMISSION_GRANTED
212 | ) {
213 | return true
214 | } else {
215 | ActivityCompat.requestPermissions(requireActivity(), permissions, 5000)
216 |
217 | }
218 |
219 | return false
220 | }
221 |
222 | fun openInstagram() {
223 | val uri: Uri = Uri.parse("http://instagram.com")
224 | val likeIng = Intent(Intent.ACTION_VIEW, uri)
225 |
226 | likeIng.setPackage("com.instagram.android")
227 |
228 | try {
229 | startActivity(likeIng)
230 | } catch (e: ActivityNotFoundException) {
231 | startActivity(
232 | Intent(
233 | Intent.ACTION_VIEW,
234 | Uri.parse("http://instagram.com/xxx")
235 | )
236 | )
237 | }
238 | }
239 |
240 |
241 | }
--------------------------------------------------------------------------------