Full Code of ihsanbal/Wiv for AI

master 52c119c81393 cached
31 files
40.0 KB
10.7k tokens
56 symbols
1 requests
Download .txt
Repository: ihsanbal/Wiv
Branch: master
Commit: 52c119c81393
Files: 31
Total size: 40.0 KB

Directory structure:
gitextract_4_q_5bw6/

├── .gitignore
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── ihsanbal/
│           │       └── com/
│           │           └── wiv/
│           │               └── MainActivity.java
│           └── res/
│               ├── layout/
│               │   └── activity_main.xml
│               ├── menu/
│               │   └── menu_main.xml
│               └── values/
│                   ├── colors.xml
│                   ├── dimens.xml
│                   ├── strings.xml
│                   └── styles.xml
├── build.gradle
├── circle.yml
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── library/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── com/
│           │       └── ihsanbal/
│           │           └── wiv/
│           │               ├── AspectRatioLayout.java
│           │               ├── MediaView.java
│           │               └── OverlayImageView.java
│           └── res/
│               └── values/
│                   ├── attrs.xml
│                   └── strings.xml
└── settings.gradle

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
*.iml
.gradle
/local.properties
.DS_Store
/captures
.externalNativeBuild

!gradle-wrapper.jar
# Generated files
bin/
gen/
out/

# Gradle files
build/

# Local configuration file (sdk path, etc)
/.idea/


================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2017 ihsan BAL

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: README.md
================================================
Wiv
--------

[![CircleCI](https://circleci.com/gh/ihsanbal/Wiv/tree/master.svg?style=svg)](https://circleci.com/gh/ihsanbal/Wiv/tree/master)
![API](https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=square)

Library of [Tweet-ui](https://docs.fabric.io/android/twitter/tweet-ui.html) TweetMediaView component.

<p align="center">
    <img src="https://github.com/ihsanbal/Wiv/blob/master/resources/logo.jpg" width="300" height="300"/>
</p>

Usage
--------

```java

MediaView mediaView;
ArrayList<String> medias;

//medias.add("http://datalook.io/app/uploads/NY.jpg");
mediaView.setOnMediaClickListener(new MediaView.OnMediaClickListener() {
    @Override
    public void onMediaClick(View view, int index) {
        Snackbar.make(view, "onClickIndex :" + index, Snackbar.LENGTH_LONG).show();
    }
});
mediaView.setMedias(medias);
```

```xml
<com.ihsanbal.wiv.AspectRatioLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="?attr/actionBarSize"
        app:aspect_ratio="1"
        app:dimension_to_adjust="height">

        <com.ihsanbal.wiv.MediaView
            android:id="@+id/media.view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="14dp"
            app:background_color="@android:color/white"
            app:corner_radii="15dp"
            app:divider_size="2dp" />

</com.ihsanbal.wiv.AspectRatioLayout>
```

Download
--------

Gradle:
```groovy
allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

dependencies {
	compile 'com.github.ihsanbal:Wiv:1.0.0'
}
```

Maven:
```xml
<repository>
   <id>jitpack.io</id>
   <url>https://jitpack.io</url>
</repository>

<dependency>
   <groupId>com.github.ihsanbal</groupId>
   <artifactId>Wiv</artifactId>
   <version>1.0.0</version>
</dependency>
```

Screenshots
--------

<p align="center">
    <img src="https://github.com/ihsanbal/Wiv/blob/master/resources/device-2017-05-31-144323.png" width="280" height="500"/>
    <img src="https://github.com/ihsanbal/Wiv/blob/master/resources/device-2017-05-31-144237.png" width="280" height="500"/>
    <img src="https://github.com/ihsanbal/Wiv/blob/master/resources/device-2017-05-31-144107.png" width="280" height="500"/>
</p>


================================================
FILE: app/.gitignore
================================================
/build


================================================
FILE: app/build.gradle
================================================
apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    //noinspection GradleDependency
    buildToolsVersion "25.0.1"
    defaultConfig {
        applicationId "ihsanbal.com.wiv"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'

//    compile project(':library')
    compile 'com.github.ihsanbal:Wiv:1.0.0'
    testCompile 'junit:junit:4.12'
}


================================================
FILE: app/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/ihsan/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: app/src/main/AndroidManifest.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="ihsanbal.com.wiv">

    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name"
            android:theme="@style/AppTheme.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

================================================
FILE: app/src/main/java/ihsanbal/com/wiv/MainActivity.java
================================================
package ihsanbal.com.wiv;

import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;

import com.ihsanbal.wiv.MediaView;

import java.util.ArrayList;

public class MainActivity extends AppCompatActivity {

    private ArrayList<String> medias = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        setSupportActionBar(toolbar);
        MediaView mediaView = (MediaView) findViewById(R.id.media_view);
        FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
        fab.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });

        medias.add("http://datalook.io/app/uploads/NY.jpg");
        medias.add("https://wallpaperbrowse.com/media/images/High-Definition-Ultra-HD-Wallpaper.jpg");
        medias.add("https://static.pexels.com/photos/17679/pexels-photo.jpg");
        mediaView.setOnMediaClickListener(new MediaView.OnMediaClickListener() {
            @Override
            public void onMediaClick(View view, int index) {
                Snackbar.make(view, "onClickIndex :" + index, Snackbar.LENGTH_LONG).show();
            }
        });
        mediaView.setMedias(medias);
    }

}


================================================
FILE: app/src/main/res/layout/activity_main.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    tools:context="ihsanbal.com.wiv.MainActivity">

    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:popupTheme="@style/AppTheme.PopupOverlay" />

    </android.support.design.widget.AppBarLayout>

    <com.ihsanbal.wiv.AspectRatioLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="?attr/actionBarSize"
        app:aspect_ratio="1"
        app:dimension_to_adjust="height">

        <com.ihsanbal.wiv.MediaView
            android:id="@+id/media.view"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="14dp"
            app:background_color="@android:color/white"
            app:corner_radii="15dp"
            app:divider_size="2dp" />

    </com.ihsanbal.wiv.AspectRatioLayout>

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        app:srcCompat="@android:drawable/ic_dialog_email" />

</android.support.design.widget.CoordinatorLayout>


================================================
FILE: app/src/main/res/menu/menu_main.xml
================================================
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="ihsanbal.com.wiv.MainActivity">
    <item
        android:id="@+id/action_settings"
        android:orderInCategory="100"
        android:title="@string/action_settings"
        app:showAsAction="never" />
</menu>


================================================
FILE: app/src/main/res/values/colors.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="colorPrimary">#3F51B5</color>
    <color name="colorPrimaryDark">#303F9F</color>
    <color name="colorAccent">#FF4081</color>
</resources>


================================================
FILE: app/src/main/res/values/dimens.xml
================================================
<resources>
    <dimen name="fab_margin">16dp</dimen>
</resources>


================================================
FILE: app/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">Wiv</string>
    <string name="action_settings">Settings</string>
</resources>


================================================
FILE: app/src/main/res/values/styles.xml
================================================
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>


================================================
FILE: build.gradle
================================================
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        maven { url 'https://jitpack.io' }
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}


================================================
FILE: circle.yml
================================================
machine:
    environment:
        ANDROID_HOME: /usr/local/android-sdk-linux
    java:
        version: oraclejdk8

dependencies:
  pre:
    - echo y | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-25.0.1,android-25,extra-google-m2repository,extra-google-google_play_services,extra-android-support,extra-android-m2repository
  override:
    - ./gradlew dependencies --daemon

test:
  override:
    - ./gradlew test

deployment:
   testing:
      branch: [development, master]
      commands:
       - ./gradlew assembleRelease

================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
#Wed May 31 11:42:20 EEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip


================================================
FILE: gradle.properties
================================================
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true


================================================
FILE: gradlew
================================================
#!/usr/bin/env bash

##############################################################################
##
##  Gradle start up script for UN*X
##
##############################################################################

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
    echo "$*"
}

die ( ) {
    echo
    echo "$*"
    echo
    exit 1
}

# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
esac

# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null

CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar

# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
    else
        JAVACMD="$JAVA_HOME/bin/java"
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
    fi
else
    JAVACMD="java"
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi

# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi

# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi

# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`

    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option

        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=$((i+1))
    done
    case $i in
        (0) set -- ;;
        (1) set -- "$args0" ;;
        (2) set -- "$args0" "$args1" ;;
        (3) set -- "$args0" "$args1" "$args2" ;;
        (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
    esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
    JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"


================================================
FILE: gradlew.bat
================================================
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windowz variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega


================================================
FILE: library/.gitignore
================================================
/build


================================================
FILE: library/build.gradle
================================================
apply plugin: 'com.android.library'

android {
    compileSdkVersion 25
    //noinspection GradleDependency
    buildToolsVersion "25.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.squareup.picasso:picasso:2.5.2'
}


================================================
FILE: library/proguard-rules.pro
================================================
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/ihsan/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile


================================================
FILE: library/src/main/AndroidManifest.xml
================================================
<manifest xmlns:android="http://schemas.android.com/apk/res/android"

    package="com.ihsanbal.wiv">

    <application android:allowBackup="true" android:label="@string/app_name"
        android:supportsRtl="true">

    </application>

</manifest>


================================================
FILE: library/src/main/java/com/ihsanbal/wiv/AspectRatioLayout.java
================================================
package com.ihsanbal.wiv;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;

/**
 * @author ihsan on 31/05/2017.
 */
public class AspectRatioLayout extends FrameLayout {

    private static final float DEFAULT_ASPECT_RATIO = 1.0f;
    private static final int DEFAULT_ADJUST_DIMENSION = 0;

    static final int ADJUST_DIMENSION_HEIGHT = 0;

    protected double aspectRatio;
    private int dimensionToAdjust;

    public AspectRatioLayout(Context context) {
        this(context, null);
    }

    public AspectRatioLayout(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public AspectRatioLayout(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        initAttributes(attrs, defStyle);
    }

    private void initAttributes(AttributeSet attrs, int styleResId) {
        final TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs,
                R.styleable.AspectRatioLayout, styleResId, 0);
        try {
            aspectRatio = a.getFloat(
                    R.styleable.AspectRatioLayout_aspect_ratio,
                    DEFAULT_ASPECT_RATIO);
            dimensionToAdjust = a.getInt(
                    R.styleable.AspectRatioLayout_dimension_to_adjust,
                    DEFAULT_ADJUST_DIMENSION);
        } finally {
            a.recycle();
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int width, height;
        final int horizontalPadding = getPaddingLeft() + getPaddingRight();
        final int verticalPadding = getPaddingBottom() + getPaddingTop();

        if (dimensionToAdjust == ADJUST_DIMENSION_HEIGHT) {
            if (View.MeasureSpec.getMode(widthMeasureSpec) == View.MeasureSpec.EXACTLY) {
                width = View.MeasureSpec.getSize(widthMeasureSpec) - horizontalPadding;
            } else {
                super.onMeasure(widthMeasureSpec, heightMeasureSpec);
                width = getMeasuredWidth() - horizontalPadding;
            }
            height = (int) (width / aspectRatio);
        } else {
            if (MeasureSpec.getMode(heightMeasureSpec) == MeasureSpec.EXACTLY) {
                height = MeasureSpec.getSize(heightMeasureSpec) - verticalPadding;
            } else {
                super.onMeasure(widthMeasureSpec, heightMeasureSpec);
                height = getMeasuredHeight() - verticalPadding;
            }
            width = (int) (height * aspectRatio);
        }

        super.onMeasure(
                View.MeasureSpec.makeMeasureSpec(width + horizontalPadding, View.MeasureSpec.EXACTLY),
                View.MeasureSpec.makeMeasureSpec(height + verticalPadding, View.MeasureSpec.EXACTLY));
    }
}


================================================
FILE: library/src/main/java/com/ihsanbal/wiv/MediaView.java
================================================
package com.ihsanbal.wiv;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Path;
import android.graphics.RectF;
import android.os.Build;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;

import java.lang.ref.WeakReference;
import java.util.Collections;
import java.util.List;

public class MediaView extends ViewGroup implements View.OnClickListener {

    static final int MAX_IMAGE_VIEW_COUNT = 4;
    private static final CharSequence CONTENT_DESC = "content_description";

    private static final int DEFAULT_DIVIDER_SIZE = 2;
    private static final int DEFAULT_CORNER_RADII = 5;

    private final OverlayImageView[] imageViews = new OverlayImageView[MAX_IMAGE_VIEW_COUNT];
    private Picasso imageLoader;
    private List<String> mediaEntities = Collections.emptyList();
    private final Path path = new Path();
    private final RectF rect = new RectF();
    private int mediaDividerSize;
    private int imageCount;
    final float[] radii = new float[8];
    int mediaBgColor;
    int photoErrorResId;

    boolean internalRoundedCornersEnabled;
    private OnMediaClickListener onMediaClickListener;
    private int roundedCornersRadii;

    public MediaView(Context context) {
        this(context, null);
    }

    public MediaView(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public MediaView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        if (!isInEditMode())
            initAttributes(attrs, defStyle, Picasso.with(context));
    }

    private void initAttributes(AttributeSet attrs, int defStyle, Picasso loader) {
        this.imageLoader = loader;
        final TypedArray a = getContext().getTheme().obtainStyledAttributes(attrs, R.styleable.MediaView, defStyle, 0);
        try {
            roundedCornersRadii = a.getDimensionPixelSize(R.styleable.MediaView_corner_radii, DEFAULT_CORNER_RADII);
            mediaDividerSize = a.getDimensionPixelSize(R.styleable.MediaView_divider_size, DEFAULT_DIVIDER_SIZE);
            photoErrorResId = a.getResourceId(R.styleable.MediaView_place_holder, R.drawable.ic_place_holder);
            mediaBgColor = a.getColor(R.styleable.MediaView_background_color, Color.WHITE);
        } finally {
            a.recycle();
        }
    }

    public void setRoundedCornersRadii(int radii) {
        this.radii[0] = radii;
        this.radii[1] = radii;
        this.radii[2] = radii;
        this.radii[3] = radii;
        this.radii[4] = radii;
        this.radii[5] = radii;
        this.radii[6] = radii;
        this.radii[7] = radii;
        requestLayout();
    }

    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        if (imageCount > 0) {
            layoutImages();
        }
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        final Size size;
        if (imageCount > 0) {
            size = measureImages(widthMeasureSpec, heightMeasureSpec);
        } else {
            size = Size.EMPTY;
        }
        setMeasuredDimension(size.width, size.height);
    }

    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);

        path.reset();
        rect.set(0, 0, w, h);
        path.addRoundRect(rect, radii, Path.Direction.CW);
        path.close();
    }

    @Override
    protected void dispatchDraw(Canvas canvas) {
        if (internalRoundedCornersEnabled &&
                Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
            final int saveState = canvas.save();
            canvas.clipPath(path);
            super.dispatchDraw(canvas);
            canvas.restoreToCount(saveState);
        } else {
            super.dispatchDraw(canvas);
        }
    }

    public void setOnMediaClickListener(OnMediaClickListener onMediaClickListener) {
        this.onMediaClickListener = onMediaClickListener;
    }

    public interface OnMediaClickListener {
        void onMediaClick(View view, int index);
    }

    @Override
    public void onClick(View view) {
        Integer mediaEntityIndex = (Integer) view.getTag();
        if (onMediaClickListener != null && mediaEntities != null && !mediaEntities.isEmpty()) {
            onMediaClickListener.onMediaClick(view, mediaEntityIndex);
        }
    }

    public void setMedias(List<String> mediaEntities) {
        this.mediaEntities = mediaEntities;
        setRoundedCornersRadii(roundedCornersRadii);
        clearImageViews();
        initializeImageViews(mediaEntities);
        internalRoundedCornersEnabled = true;
        requestLayout();
    }

    Size measureImages(int widthMeasureSpec, int heightMeasureSpec) {
        final int width = MeasureSpec.getSize(widthMeasureSpec);
        final int height = MeasureSpec.getSize(heightMeasureSpec);
        final int halfWidth = (width - mediaDividerSize) / 2;
        final int halfHeight = (height - mediaDividerSize) / 2;
        switch (imageCount) {
            case 1:
                measureImageView(0, width, height);
                break;
            case 2:
                measureImageView(0, halfWidth, height);
                measureImageView(1, halfWidth, height);
                break;
            case 3:
                measureImageView(0, halfWidth, height);
                measureImageView(1, halfWidth, halfHeight);
                measureImageView(2, halfWidth, halfHeight);
                break;
            case 4:
                measureImageView(0, halfWidth, halfHeight);
                measureImageView(1, halfWidth, halfHeight);
                measureImageView(2, halfWidth, halfHeight);
                measureImageView(3, halfWidth, halfHeight);
                break;
            default:
                break;
        }
        return Size.fromSize(width, height);
    }

    void measureImageView(int i, int width, int height) {
        imageViews[i].measure(
                MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
                MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY));
    }

    void layoutImages() {
        int width = getMeasuredWidth();
        int height = getMeasuredHeight();
        int halfWidth = (width - mediaDividerSize) / 2;
        int halfHeight = (height - mediaDividerSize) / 2;
        int middle = halfWidth + mediaDividerSize;
        switch (imageCount) {
            case 1:
                layoutImage(0, 0, 0, width, height);
                break;
            case 2:
                layoutImage(0, 0, 0, halfWidth, height);
                layoutImage(1, halfWidth + mediaDividerSize, 0, width, height);
                break;
            case 3:
                layoutImage(0, 0, 0, halfWidth, height);
                layoutImage(1, middle, 0, width, halfHeight);
                layoutImage(2, middle, halfHeight + mediaDividerSize, width, height);
                break;
            case 4:
                layoutImage(0, 0, 0, halfWidth, halfHeight);
                layoutImage(2, 0, halfHeight + mediaDividerSize, halfWidth, height);
                layoutImage(1, middle, 0, width, halfHeight);
                layoutImage(3, middle, halfHeight + mediaDividerSize, width, height);
                break;
            default:
                break;
        }
    }

    void layoutImage(int i, int left, int top, int right, int bottom) {
        final ImageView view = imageViews[i];
        if (view.getLeft() == left && view.getTop() == top && view.getRight() == right
                && view.getBottom() == bottom) {
            return;
        }

        view.layout(left, top, right, bottom);
    }

    void clearImageViews() {
        for (int index = 0; index < imageCount; index++) {
            final ImageView imageView = imageViews[index];
            if (imageView != null) {
                imageView.setVisibility(GONE);
            }
        }
        imageCount = 0;
    }

    void initializeImageViews(List<String> mediaEntities) {
        imageCount = Math.min(MAX_IMAGE_VIEW_COUNT, mediaEntities.size());

        for (int index = 0; index < imageCount; index++) {
            final OverlayImageView imageView = getOrCreateImageView(index);

            final String mediaEntity = mediaEntities.get(index);
            setAltText(imageView, "media");
            setMediaImage(imageView, mediaEntity);
            setOverlayImage(imageView);
        }
    }

    OverlayImageView getOrCreateImageView(int index) {
        OverlayImageView imageView = imageViews[index];
        if (imageView == null) {
            imageView = new OverlayImageView(getContext());
            imageView.setLayoutParams(generateDefaultLayoutParams());
            imageView.setOnClickListener(this);
            imageViews[index] = imageView;
            addView(imageView, index);
        } else {
            measureImageView(index, 0, 0);
            layoutImage(index, 0, 0, 0, 0);
        }

        imageView.setVisibility(VISIBLE);
        imageView.setBackgroundColor(mediaBgColor);
        imageView.setTag(index);

        return imageView;
    }

    @SuppressLint("PrivateResource")
    void setAltText(ImageView imageView, String description) {
        if (!TextUtils.isEmpty(description)) {
            imageView.setContentDescription(description);
        } else {
            imageView.setContentDescription(CONTENT_DESC);
        }
    }

    @SuppressLint("PrivateResource")
    void setOverlayImage(OverlayImageView imageView) {
        imageView.setOverlayDrawable(null);
    }

    void setMediaImage(ImageView imageView, String imagePath) {
        if (imageLoader == null) return;
        imageLoader.load(imagePath)
                .fit()
                .centerCrop()
                .error(photoErrorResId)
                .into(imageView, new PicassoCallback(imageView));
    }

    private static class PicassoCallback implements com.squareup.picasso.Callback {
        final WeakReference<ImageView> imageViewWeakReference;

        PicassoCallback(ImageView imageView) {
            imageViewWeakReference = new WeakReference<>(imageView);
        }

        @Override
        public void onSuccess() {
            final ImageView imageView = imageViewWeakReference.get();
            if (imageView != null) {
                imageView.setBackgroundResource(android.R.color.transparent);
            }
        }

        @Override
        public void onError() { /* intentionally blank */ }
    }

    private static class Size {
        static final Size EMPTY = new Size();
        final int width;
        final int height;

        private Size() {
            this(0, 0);
        }

        private Size(int width, int height) {
            this.width = width;
            this.height = height;
        }

        static Size fromSize(int w, int h) {
            final int boundedWidth = Math.max(w, 0);
            final int boundedHeight = Math.max(h, 0);
            return boundedWidth != 0 || boundedHeight != 0 ?
                    new Size(boundedWidth, boundedHeight) : EMPTY;
        }
    }

}


================================================
FILE: library/src/main/java/com/ihsanbal/wiv/OverlayImageView.java
================================================
package com.ihsanbal.wiv;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.widget.ImageView;

/**
 * An ImageView subclass that take a {@link android.graphics.drawable.Drawable} and draws it on top
 * the ImageView content.
 */
public class OverlayImageView extends ImageView {
    Overlay overlay = new Overlay(null);

    public OverlayImageView(Context context) {
        super(context);
    }

    public OverlayImageView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        super.onDraw(canvas);
        overlay.draw(canvas);
    }

    @Override
    protected void drawableStateChanged() {
        super.drawableStateChanged();
        overlay.setDrawableState(getDrawableState());
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        overlay.setDrawableBounds(getMeasuredWidth(), getMeasuredHeight());
    }

    @Override
    protected void onSizeChanged(int width, int height, int oldWidth, int oldHeight) {
        super.onSizeChanged(width, height, oldWidth, oldHeight);
        overlay.setDrawableBounds(width, height);
    }

    @Override
    public void invalidateDrawable(Drawable drawable) {
        if (drawable == overlay.drawable) {
            invalidate();
        } else {
            super.invalidateDrawable(drawable);
        }
    }

    /*
     * Sets the drawable to be drawn on top the ImageView content.
     *
     * @param drawable The drawable
     */
    public void setOverlayDrawable(Drawable drawable) {
        if (drawable != overlay.drawable) {
            overlay.cleanupDrawable(this);
            if (drawable != null) {
                drawable.setCallback(this);
            }

            overlay = new Overlay(drawable);
            overlay.setDrawableState(getDrawableState());
            requestLayout();
        }
    }

    /**
     * Takes a {@link android.graphics.drawable.Drawable} and draws it on top the ImageView content.
     * The overlay drawable will respect the view's current state so a selector can be passed in.
     */
    static protected class Overlay {
        final Drawable drawable;

        Overlay(Drawable drawable) {
            this.drawable = drawable;
        }

        protected void cleanupDrawable(ImageView imageView) {
            if (drawable != null) {
                drawable.setCallback(null);
                imageView.unscheduleDrawable(drawable);
            }
        }

        protected void setDrawableBounds(int width, int height) {
            if (drawable != null) {
                drawable.setBounds(0, 0, width, height);
            }
        }

        protected void setDrawableState(int[] state) {
            if (drawable != null && drawable.isStateful()) {
                drawable.setState(state);
            }
        }

        protected void draw(Canvas canvas) {
            if (drawable != null) {
                drawable.draw(canvas);
            }
        }
    }
}


================================================
FILE: library/src/main/res/values/attrs.xml
================================================
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <declare-styleable name="AspectRatioLayout">
        <attr name="aspect_ratio" format="float" />
        <attr name="dimension_to_adjust" format="enum">
            <enum name="height" value="0" />
            <enum name="width" value="1" />
        </attr>
    </declare-styleable>

    <declare-styleable name="MediaView">
        <attr name="divider_size" format="dimension" />
        <attr name="place_holder" format="integer" />
        <attr name="corner_radii" format="dimension" />
        <attr name="background_color" format="color" />
    </declare-styleable>
</resources>

================================================
FILE: library/src/main/res/values/strings.xml
================================================
<resources>
    <string name="app_name">Library</string>
</resources>


================================================
FILE: settings.gradle
================================================
include ':app', ':library'
Download .txt
gitextract_4_q_5bw6/

├── .gitignore
├── LICENSE
├── README.md
├── app/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── ihsanbal/
│           │       └── com/
│           │           └── wiv/
│           │               └── MainActivity.java
│           └── res/
│               ├── layout/
│               │   └── activity_main.xml
│               ├── menu/
│               │   └── menu_main.xml
│               └── values/
│                   ├── colors.xml
│                   ├── dimens.xml
│                   ├── strings.xml
│                   └── styles.xml
├── build.gradle
├── circle.yml
├── gradle/
│   └── wrapper/
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── library/
│   ├── .gitignore
│   ├── build.gradle
│   ├── proguard-rules.pro
│   └── src/
│       └── main/
│           ├── AndroidManifest.xml
│           ├── java/
│           │   └── com/
│           │       └── ihsanbal/
│           │           └── wiv/
│           │               ├── AspectRatioLayout.java
│           │               ├── MediaView.java
│           │               └── OverlayImageView.java
│           └── res/
│               └── values/
│                   ├── attrs.xml
│                   └── strings.xml
└── settings.gradle
Download .txt
SYMBOL INDEX (56 symbols across 4 files)

FILE: app/src/main/java/ihsanbal/com/wiv/MainActivity.java
  class MainActivity (line 14) | public class MainActivity extends AppCompatActivity {
    method onCreate (line 18) | @Override

FILE: library/src/main/java/com/ihsanbal/wiv/AspectRatioLayout.java
  class AspectRatioLayout (line 12) | public class AspectRatioLayout extends FrameLayout {
    method AspectRatioLayout (line 22) | public AspectRatioLayout(Context context) {
    method AspectRatioLayout (line 26) | public AspectRatioLayout(Context context, AttributeSet attrs) {
    method AspectRatioLayout (line 30) | public AspectRatioLayout(Context context, AttributeSet attrs, int defS...
    method initAttributes (line 35) | private void initAttributes(AttributeSet attrs, int styleResId) {
    method onMeasure (line 50) | @Override

FILE: library/src/main/java/com/ihsanbal/wiv/MediaView.java
  class MediaView (line 23) | public class MediaView extends ViewGroup implements View.OnClickListener {
    method MediaView (line 46) | public MediaView(Context context) {
    method MediaView (line 50) | public MediaView(Context context, AttributeSet attrs) {
    method MediaView (line 54) | public MediaView(Context context, AttributeSet attrs, int defStyle) {
    method initAttributes (line 60) | private void initAttributes(AttributeSet attrs, int defStyle, Picasso ...
    method setRoundedCornersRadii (line 73) | public void setRoundedCornersRadii(int radii) {
    method onLayout (line 85) | @Override
    method onMeasure (line 92) | @Override
    method onSizeChanged (line 103) | @Override
    method dispatchDraw (line 113) | @Override
    method setOnMediaClickListener (line 126) | public void setOnMediaClickListener(OnMediaClickListener onMediaClickL...
    type OnMediaClickListener (line 130) | public interface OnMediaClickListener {
      method onMediaClick (line 131) | void onMediaClick(View view, int index);
    method onClick (line 134) | @Override
    method setMedias (line 142) | public void setMedias(List<String> mediaEntities) {
    method measureImages (line 151) | Size measureImages(int widthMeasureSpec, int heightMeasureSpec) {
    method measureImageView (line 181) | void measureImageView(int i, int width, int height) {
    method layoutImages (line 187) | void layoutImages() {
    method layoutImage (line 217) | void layoutImage(int i, int left, int top, int right, int bottom) {
    method clearImageViews (line 227) | void clearImageViews() {
    method initializeImageViews (line 237) | void initializeImageViews(List<String> mediaEntities) {
    method getOrCreateImageView (line 250) | OverlayImageView getOrCreateImageView(int index) {
    method setAltText (line 270) | @SuppressLint("PrivateResource")
    method setOverlayImage (line 279) | @SuppressLint("PrivateResource")
    method setMediaImage (line 284) | void setMediaImage(ImageView imageView, String imagePath) {
    class PicassoCallback (line 293) | private static class PicassoCallback implements com.squareup.picasso.C...
      method PicassoCallback (line 296) | PicassoCallback(ImageView imageView) {
      method onSuccess (line 300) | @Override
      method onError (line 308) | @Override
    class Size (line 312) | private static class Size {
      method Size (line 317) | private Size() {
      method Size (line 321) | private Size(int width, int height) {
      method fromSize (line 326) | static Size fromSize(int w, int h) {

FILE: library/src/main/java/com/ihsanbal/wiv/OverlayImageView.java
  class OverlayImageView (line 13) | public class OverlayImageView extends ImageView {
    method OverlayImageView (line 16) | public OverlayImageView(Context context) {
    method OverlayImageView (line 20) | public OverlayImageView(Context context, AttributeSet attrs) {
    method onDraw (line 24) | @Override
    method drawableStateChanged (line 30) | @Override
    method onMeasure (line 36) | @Override
    method onSizeChanged (line 42) | @Override
    method invalidateDrawable (line 48) | @Override
    method setOverlayDrawable (line 62) | public void setOverlayDrawable(Drawable drawable) {
    class Overlay (line 79) | static protected class Overlay {
      method Overlay (line 82) | Overlay(Drawable drawable) {
      method cleanupDrawable (line 86) | protected void cleanupDrawable(ImageView imageView) {
      method setDrawableBounds (line 93) | protected void setDrawableBounds(int width, int height) {
      method setDrawableState (line 99) | protected void setDrawableState(int[] state) {
      method draw (line 105) | protected void draw(Canvas canvas) {
Condensed preview — 31 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (44K chars).
[
  {
    "path": ".gitignore",
    "chars": 202,
    "preview": "*.iml\n.gradle\n/local.properties\n.DS_Store\n/captures\n.externalNativeBuild\n\n!gradle-wrapper.jar\n# Generated files\nbin/\ngen"
  },
  {
    "path": "LICENSE",
    "chars": 1066,
    "preview": "MIT License\n\nCopyright (c) 2017 ihsan BAL\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n"
  },
  {
    "path": "README.md",
    "chars": 2328,
    "preview": "Wiv\n--------\n\n[![CircleCI](https://circleci.com/gh/ihsanbal/Wiv/tree/master.svg?style=svg)](https://circleci.com/gh/ihsa"
  },
  {
    "path": "app/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "app/build.gradle",
    "chars": 1029,
    "preview": "apply plugin: 'com.android.application'\n\nandroid {\n    compileSdkVersion 25\n    //noinspection GradleDependency\n    buil"
  },
  {
    "path": "app/proguard-rules.pro",
    "chars": 934,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "app/src/main/AndroidManifest.xml",
    "chars": 890,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package="
  },
  {
    "path": "app/src/main/java/ihsanbal/com/wiv/MainActivity.java",
    "chars": 1602,
    "preview": "package ihsanbal.com.wiv;\n\nimport android.os.Bundle;\nimport android.support.design.widget.FloatingActionButton;\nimport a"
  },
  {
    "path": "app/src/main/res/layout/activity_main.xml",
    "chars": 2003,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<android.support.design.widget.CoordinatorLayout xmlns:android=\"http://schemas.an"
  },
  {
    "path": "app/src/main/res/menu/menu_main.xml",
    "chars": 405,
    "preview": "<menu xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\""
  },
  {
    "path": "app/src/main/res/values/colors.xml",
    "chars": 208,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"color"
  },
  {
    "path": "app/src/main/res/values/dimens.xml",
    "chars": 67,
    "preview": "<resources>\n    <dimen name=\"fab_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/strings.xml",
    "chars": 119,
    "preview": "<resources>\n    <string name=\"app_name\">Wiv</string>\n    <string name=\"action_settings\">Settings</string>\n</resources>\n"
  },
  {
    "path": "app/src/main/res/values/styles.xml",
    "chars": 708,
    "preview": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar"
  },
  {
    "path": "build.gradle",
    "chars": 541,
    "preview": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    r"
  },
  {
    "path": "circle.yml",
    "chars": 555,
    "preview": "machine:\n    environment:\n        ANDROID_HOME: /usr/local/android-sdk-linux\n    java:\n        version: oraclejdk8\n\ndepe"
  },
  {
    "path": "gradle/wrapper/gradle-wrapper.properties",
    "chars": 231,
    "preview": "#Wed May 31 11:42:20 EEST 2017\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER"
  },
  {
    "path": "gradle.properties",
    "chars": 730,
    "preview": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will o"
  },
  {
    "path": "gradlew",
    "chars": 4971,
    "preview": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start "
  },
  {
    "path": "gradlew.bat",
    "chars": 2314,
    "preview": "@if \"%DEBUG%\" == \"\" @echo off\n@rem ##########################################################################\n@rem\n@rem "
  },
  {
    "path": "library/.gitignore",
    "chars": 7,
    "preview": "/build\n"
  },
  {
    "path": "library/build.gradle",
    "chars": 570,
    "preview": "apply plugin: 'com.android.library'\n\nandroid {\n    compileSdkVersion 25\n    //noinspection GradleDependency\n    buildToo"
  },
  {
    "path": "library/proguard-rules.pro",
    "chars": 934,
    "preview": "# Add project specific ProGuard rules here.\n# By default, the flags in this file are appended to flags specified\n# in /U"
  },
  {
    "path": "library/src/main/AndroidManifest.xml",
    "chars": 249,
    "preview": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n\n    package=\"com.ihsanbal.wiv\">\n\n    <application "
  },
  {
    "path": "library/src/main/java/com/ihsanbal/wiv/AspectRatioLayout.java",
    "chars": 2864,
    "preview": "package com.ihsanbal.wiv;\n\nimport android.content.Context;\nimport android.content.res.TypedArray;\nimport android.util.At"
  },
  {
    "path": "library/src/main/java/com/ihsanbal/wiv/MediaView.java",
    "chars": 11449,
    "preview": "package com.ihsanbal.wiv;\n\nimport android.annotation.SuppressLint;\nimport android.content.Context;\nimport android.conten"
  },
  {
    "path": "library/src/main/java/com/ihsanbal/wiv/OverlayImageView.java",
    "chars": 3198,
    "preview": "package com.ihsanbal.wiv;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.drawa"
  },
  {
    "path": "library/src/main/res/values/attrs.xml",
    "chars": 639,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <declare-styleable name=\"AspectRatioLayout\">\n        <attr name=\""
  },
  {
    "path": "library/src/main/res/values/strings.xml",
    "chars": 70,
    "preview": "<resources>\n    <string name=\"app_name\">Library</string>\n</resources>\n"
  },
  {
    "path": "settings.gradle",
    "chars": 27,
    "preview": "include ':app', ':library'\n"
  }
]

// ... and 1 more files (download for full content)

About this extraction

This page contains the full source code of the ihsanbal/Wiv GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 31 files (40.0 KB), approximately 10.7k tokens, and a symbol index with 56 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!