diff --git a/StarWars.iml b/StarWars.iml
deleted file mode 100644
index 115e577..0000000
--- a/StarWars.iml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index e370516..c31175e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -2,13 +2,15 @@
buildscript {
repositories {
+ google()
jcenter()
+ mavenCentral()
+ maven { url 'https://jitpack.io' }
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
- classpath 'com.android.tools.build:gradle:2.1.0-alpha3'
- classpath 'io.fabric.tools:gradle:1.21.0'
-
+ classpath 'com.android.tools.build:gradle:4.0.0'
+ classpath 'io.fabric.tools:gradle:1.28.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
@@ -16,7 +18,10 @@ buildscript {
allprojects {
repositories {
+ google()
jcenter()
+ maven { url 'https://jitpack.io' }
+ maven { url 'https://maven.google.com/' }
}
}
diff --git a/demo/build.gradle b/demo/build.gradle
index ad840a5..3bd840b 100644
--- a/demo/build.gradle
+++ b/demo/build.gradle
@@ -4,7 +4,7 @@ buildscript {
}
dependencies {
- classpath 'io.fabric.tools:gradle:1.21.0'
+ classpath 'io.fabric.tools:gradle:1.28.0'
}
}
apply plugin: 'com.android.application'
@@ -17,13 +17,13 @@ apply plugin: 'io.fabric'
android {
- compileSdkVersion 23
- buildToolsVersion '23.0.2'
+ compileSdkVersion 29
+ buildToolsVersion '29.0.3'
defaultConfig {
applicationId "com.yalantis.starwarsdemo"
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 29
versionCode 1
versionName "0.1.0"
}
@@ -36,19 +36,23 @@ android {
dataBinding {
enabled = false
}
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
}
dependencies {
- compile fileTree(dir: 'libs', include: ['*.jar'])
- testCompile 'junit:junit:4.12'
- compile 'com.android.support:appcompat-v7:23.1.1'
- compile 'com.android.support:design:23.1.1'
- compile 'com.jakewharton.timber:timber:4.1.0'
- compile 'com.jakewharton:butterknife:7.0.1'
- compile 'com.android.support:recyclerview-v7:23.1.1'
- compile 'com.android.support:percent:23.1.1'
- compile project(':library')
- compile('com.crashlytics.sdk.android:crashlytics:2.5.3@aar') {
- transitive = true;
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ testImplementation 'junit:junit:4.12'
+ implementation 'androidx.appcompat:appcompat:1.1.0'
+ implementation 'com.google.android.material:material:1.1.0'
+ implementation 'com.jakewharton.timber:timber:4.1.0'
+ implementation 'androidx.recyclerview:recyclerview:1.1.0'
+ implementation 'androidx.percentlayout:percentlayout:1.0.0'
+ implementation project(':library')
+ implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') {
+ transitive = true
}
}
diff --git a/demo/demo.iml b/demo/demo.iml
deleted file mode 100644
index 4aecc03..0000000
--- a/demo/demo.iml
+++ /dev/null
@@ -1,127 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- generateDebugSources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/demo/src/main/java/com/yalantis/starwarsdemo/adapter/ProfileAdapter.java b/demo/src/main/java/com/yalantis/starwarsdemo/adapter/ProfileAdapter.java
index cb43260..3ab638b 100644
--- a/demo/src/main/java/com/yalantis/starwarsdemo/adapter/ProfileAdapter.java
+++ b/demo/src/main/java/com/yalantis/starwarsdemo/adapter/ProfileAdapter.java
@@ -1,23 +1,20 @@
package com.yalantis.starwarsdemo.adapter;
import android.content.Context;
-import android.support.annotation.LayoutRes;
-import android.support.annotation.Nullable;
-import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.TextView;
+import androidx.annotation.LayoutRes;
+import androidx.recyclerview.widget.RecyclerView;
+
import com.yalantis.starwarsdemo.R;
import com.yalantis.starwarsdemo.interfaces.ProfileAdapterListener;
import com.yalantis.starwarsdemo.model.User;
import com.yalantis.starwarsdemo.widget.BackgroundDrawableSwitchCompat;
-import butterknife.Bind;
-import butterknife.ButterKnife;
-
/**
* Created by Artem Kholodnyi on 11/17/15.
*/
@@ -26,12 +23,11 @@ public class ProfileAdapter extends RecyclerView.Adapter doBreak());
return mRootView;
}
-
-
-
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
@@ -212,11 +209,9 @@ private void setUpToolbar(final Toolbar toolbar) {
abstract User getUser();
-
@Override
public void onDestroyView() {
super.onDestroyView();
- ButterKnife.unbind(this);
}
@Override
@@ -230,7 +225,7 @@ public void onSideSwitch(SwitchCompat v) {
if (this instanceof BrightSideFragment && v.isChecked()) {
cx = rect.right - halfThumbWidth;
postGoToSide(cy, cx, "dark");
- } else if (!v.isChecked()){
+ } else if (!v.isChecked()) {
cx = rect.left + halfThumbWidth;
postGoToSide(cy, cx, "bright");
}
@@ -278,8 +273,4 @@ public void onAnimationFinished() {
public abstract String getTagString();
- @OnClick(R.id.btn_save)
- void onClick() {
- doBreak();
- }
}
diff --git a/demo/src/main/java/com/yalantis/starwarsdemo/widget/BackgroundDrawableSwitchCompat.java b/demo/src/main/java/com/yalantis/starwarsdemo/widget/BackgroundDrawableSwitchCompat.java
index c2aaee2..931f085 100644
--- a/demo/src/main/java/com/yalantis/starwarsdemo/widget/BackgroundDrawableSwitchCompat.java
+++ b/demo/src/main/java/com/yalantis/starwarsdemo/widget/BackgroundDrawableSwitchCompat.java
@@ -4,16 +4,18 @@
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
+import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.LevelListDrawable;
-import android.support.annotation.IntRange;
-import android.support.v4.content.ContextCompat;
-import android.support.v7.widget.SwitchCompat;
import android.util.AttributeSet;
import android.view.animation.Animation;
import android.view.animation.LinearInterpolator;
+import androidx.annotation.IntRange;
+import androidx.appcompat.widget.SwitchCompat;
+import androidx.core.content.ContextCompat;
+
import com.yalantis.starwarsdemo.R;
/**
@@ -66,6 +68,28 @@ public void setCheckedImmediate(boolean checked) {
mTwoStatesDrawable.setBlend(checked ? OPAQUE : TRANSPARENT);
}
+ private void startAnimation(boolean firstToSecond) {
+ if (animator != null) {
+ animator.cancel();
+ }
+ animator = ValueAnimator.ofInt(firstToSecond ? OPAQUE : TRANSPARENT, firstToSecond ? TRANSPARENT : OPAQUE);
+ animator.setDuration(THUMB_ANIMATION_DURATION);
+ animator.setInterpolator(new LinearInterpolator());
+// animator.setRepeatMode(ValueAnimator.RESTART);
+// animator.setRepeatCount(ValueAnimator.INFINITE);
+
+ animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
+ @Override
+ public void onAnimationUpdate(ValueAnimator animation) {
+ mFirstDrawableAlpha = (int) animation.getAnimatedValue();
+ mSecondDrawableAlpha = OPAQUE - (int) animation.getAnimatedValue();
+ invalidate();
+ }
+ });
+
+ animator.start();
+ }
+
private class TwoStatesTrackDrawable extends LevelListDrawable {
private final Drawable mFirstDrawable;
private final Drawable mSecondDrawable;
@@ -101,9 +125,10 @@ public void setColorFilter(ColorFilter colorFilter) {
}
+
@Override
public int getOpacity() {
- return 0;
+ return PixelFormat.UNKNOWN;
}
private void setBlend(@IntRange(from = TRANSPARENT, to = OPAQUE) int k) {
@@ -113,26 +138,4 @@ private void setBlend(@IntRange(from = TRANSPARENT, to = OPAQUE) int k) {
}
}
- private void startAnimation(boolean firstToSecond) {
- if (animator != null) {
- animator.cancel();
- }
- animator = ValueAnimator.ofInt(firstToSecond ? OPAQUE : TRANSPARENT, firstToSecond ? TRANSPARENT : OPAQUE);
- animator.setDuration(THUMB_ANIMATION_DURATION);
- animator.setInterpolator(new LinearInterpolator());
-// animator.setRepeatMode(ValueAnimator.RESTART);
-// animator.setRepeatCount(ValueAnimator.INFINITE);
-
- animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
- @Override
- public void onAnimationUpdate(ValueAnimator animation) {
- mFirstDrawableAlpha = (int) animation.getAnimatedValue();
- mSecondDrawableAlpha = OPAQUE - (int) animation.getAnimatedValue();
- invalidate();
- }
- });
-
- animator.start();
- }
-
}
diff --git a/demo/src/main/java/com/yalantis/starwarsdemo/widget/CenterTopImageView.java b/demo/src/main/java/com/yalantis/starwarsdemo/widget/CenterTopImageView.java
index 733a31e..117889d 100644
--- a/demo/src/main/java/com/yalantis/starwarsdemo/widget/CenterTopImageView.java
+++ b/demo/src/main/java/com/yalantis/starwarsdemo/widget/CenterTopImageView.java
@@ -3,12 +3,13 @@
import android.content.Context;
import android.graphics.Matrix;
import android.util.AttributeSet;
-import android.widget.ImageView;
+
+import androidx.appcompat.widget.AppCompatImageView;
/**
* Created by Artem Kholodnyi on 11/23/15.
*/
-public class CenterTopImageView extends ImageView {
+public class CenterTopImageView extends AppCompatImageView {
private Matrix matrix = new Matrix();
public CenterTopImageView(Context context) {
diff --git a/demo/src/main/res/layout/fragment_greetings.xml b/demo/src/main/res/layout/fragment_greetings.xml
index b39d3fe..869250d 100644
--- a/demo/src/main/res/layout/fragment_greetings.xml
+++ b/demo/src/main/res/layout/fragment_greetings.xml
@@ -1,60 +1,57 @@
-
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="vertical">
-
+ android:layout_height="?android:attr/actionBarSize" />
+ android:textColor="@android:color/white"
+ android:textSize="22sp" />
+ android:text="@string/btn_setup_profile"
+ android:textAllCaps="false"
+ android:textColor="@android:color/white"
+ android:textSize="20sp" />
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/demo/src/main/res/layout/fragment_side.xml b/demo/src/main/res/layout/fragment_side.xml
index f2fc64d..d73f66c 100644
--- a/demo/src/main/res/layout/fragment_side.xml
+++ b/demo/src/main/res/layout/fragment_side.xml
@@ -1,84 +1,75 @@
-
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ app:sw_numberOfTilesX="35">
-
-
+ android:layout_width="match_parent"
+ android:layout_height="@dimen/appbar_height">
-
+ app:contentScrim="?attr/toolbarBackground"
+ app:expandedTitleTextAppearance="@style/TransparentTextAppearance"
+ app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
+ android:layout_gravity="top"
+ app:layout_collapseMode="parallax" />
-
+ android:layout_height="?attr/actionBarSize"
+ app:layout_collapseMode="pin" />
-
+
-
+
-
+ app:layout_behavior="@string/appbar_scrolling_view_behavior" />
+ android:textColor="@android:color/white" />
-
+
diff --git a/gradle.properties b/gradle.properties
index 1d3591c..c011393 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -15,4 +15,8 @@
# 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
\ No newline at end of file
+ org.gradle.parallel=true
+
+# Using androidx libraries
+android.useAndroidX=true
+android.enableJetifier=true
\ No newline at end of file
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 8c0fb64..13372ae 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 41b3fb6..29dd7e3 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Thu Feb 18 12:33:48 EET 2016
+#Fri Apr 03 14:21:23 EET 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
\ No newline at end of file
diff --git a/library/build.gradle b/library/build.gradle
index 6f996ce..9fc8bfe 100644
--- a/library/build.gradle
+++ b/library/build.gradle
@@ -1,12 +1,12 @@
apply plugin: 'com.android.library'
android {
- compileSdkVersion 23
- buildToolsVersion '23.0.2'
+ compileSdkVersion 29
+ buildToolsVersion '29.0.3'
defaultConfig {
minSdkVersion 15
- targetSdkVersion 23
+ targetSdkVersion 29
versionCode 2
versionName "0.1.1"
}
@@ -20,6 +20,5 @@ android {
}
dependencies {
- compile 'com.android.support:support-annotations:23.1.1'
- compile 'com.jakewharton.timber:timber:4.1.0'
+ implementation 'androidx.annotation:annotation:1.1.0'
}
diff --git a/library/library.iml b/library/library.iml
deleted file mode 100644
index 276e9e0..0000000
--- a/library/library.iml
+++ /dev/null
@@ -1,100 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- generateDebugSources
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/library/src/main/AndroidManifest.xml b/library/src/main/AndroidManifest.xml
index 95810b9..9c27b7f 100644
--- a/library/src/main/AndroidManifest.xml
+++ b/library/src/main/AndroidManifest.xml
@@ -1,8 +1,8 @@
+ package="com.yalantis.starwars">
-
-
-
+
diff --git a/library/src/main/java/com/yalantis/starwars/interfaces/ShaderType.java b/library/src/main/java/com/yalantis/starwars/interfaces/ShaderType.java
index a8a5c46..d6df6e3 100644
--- a/library/src/main/java/com/yalantis/starwars/interfaces/ShaderType.java
+++ b/library/src/main/java/com/yalantis/starwars/interfaces/ShaderType.java
@@ -1,7 +1,9 @@
package com.yalantis.starwars.interfaces;
+
import android.opengl.GLES20;
-import android.support.annotation.IntDef;
+
+import androidx.annotation.IntDef;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
diff --git a/library/src/main/java/com/yalantis/starwars/render/StarWarsRenderer.java b/library/src/main/java/com/yalantis/starwars/render/StarWarsRenderer.java
index e99f456..aaeb6d1 100644
--- a/library/src/main/java/com/yalantis/starwars/render/StarWarsRenderer.java
+++ b/library/src/main/java/com/yalantis/starwars/render/StarWarsRenderer.java
@@ -23,8 +23,6 @@
import javax.microedition.khronos.egl.EGLConfig;
import javax.microedition.khronos.opengles.GL10;
-import timber.log.Timber;
-
/**
* Created by Artem Kholodnyi on 11/2/15.
@@ -233,7 +231,6 @@ public void logFrame() {
frames++;
timePassed = (System.nanoTime() - startTime) / 1_000_000;
if(timePassed >= 1000) {
- Timber.d("%d tiles @ %d fps", getTilesCount(), frames);
frames = 0;
startTime = System.nanoTime();
}
diff --git a/library/src/main/java/com/yalantis/starwars/utils/gl/RawResourceReader.java b/library/src/main/java/com/yalantis/starwars/utils/gl/RawResourceReader.java
index 01f93bf..b2a96a9 100644
--- a/library/src/main/java/com/yalantis/starwars/utils/gl/RawResourceReader.java
+++ b/library/src/main/java/com/yalantis/starwars/utils/gl/RawResourceReader.java
@@ -1,9 +1,10 @@
package com.yalantis.starwars.utils.gl;
import android.content.Context;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.support.annotation.RawRes;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.RawRes;
import java.io.BufferedReader;
import java.io.IOException;
diff --git a/library/src/main/java/com/yalantis/starwars/utils/gl/ShaderHelper.java b/library/src/main/java/com/yalantis/starwars/utils/gl/ShaderHelper.java
index af27f82..7c4bc74 100644
--- a/library/src/main/java/com/yalantis/starwars/utils/gl/ShaderHelper.java
+++ b/library/src/main/java/com/yalantis/starwars/utils/gl/ShaderHelper.java
@@ -5,91 +5,88 @@
import com.yalantis.starwars.interfaces.ShaderType;
-import timber.log.Timber;
-
public class ShaderHelper {
- private static final String TAG = "ShaderHelper";
-
- /**
- * Helper function to compile a shader.
- *
- * @param shaderType The shader type.
- * @param shaderSource The shader source code.
- * @return An OpenGL handle to the shader.
- */
- public static int compileShader(@ShaderType final int shaderType, final String shaderSource) {
- int shaderHandle = GLES20.glCreateShader(shaderType);
-
- if (shaderHandle != 0) {
- GLES20.glShaderSource(shaderHandle, shaderSource);
-
- GLES20.glCompileShader(shaderHandle);
-
- final int[] compilationStatus = new int[1];
- GLES20.glGetShaderiv(shaderHandle, GLES20.GL_COMPILE_STATUS, compilationStatus, 0);
-
- if (compilationStatus[0] == 0) {
- Timber.e("Error compiling shader %s", GLES20.glGetShaderInfoLog(shaderHandle));
- GLES20.glDeleteShader(shaderHandle);
- shaderHandle = 0;
- }
- }
-
- if (shaderHandle == 0) {
- throw new RuntimeException("Error creating shader.");
- }
-
- return shaderHandle;
- }
-
- /**
- * Helper function to compile and link a program.
- *
- * @param vertexShaderHandle An OpenGL handle to an already-compiled vertex shader.
- * @param fragmentShaderHandle An OpenGL handle to an already-compiled fragment shader.
- * @param attributes Attributes that need to be bound to the program.
- * @return An OpenGL handle to the program.
- */
- public static int createAndLinkProgram(final int vertexShaderHandle,
+ private static final String TAG = "ShaderHelper";
+
+ /**
+ * Helper function to compile a shader.
+ *
+ * @param shaderType The shader type.
+ * @param shaderSource The shader source code.
+ * @return An OpenGL handle to the shader.
+ */
+ public static int compileShader(@ShaderType final int shaderType, final String shaderSource) {
+ int shaderHandle = GLES20.glCreateShader(shaderType);
+
+ if (shaderHandle != 0) {
+ GLES20.glShaderSource(shaderHandle, shaderSource);
+
+ GLES20.glCompileShader(shaderHandle);
+
+ final int[] compilationStatus = new int[1];
+ GLES20.glGetShaderiv(shaderHandle, GLES20.GL_COMPILE_STATUS, compilationStatus, 0);
+
+ if (compilationStatus[0] == 0) {
+ GLES20.glDeleteShader(shaderHandle);
+ shaderHandle = 0;
+ }
+ }
+
+ if (shaderHandle == 0) {
+ throw new RuntimeException("Error creating shader.");
+ }
+
+ return shaderHandle;
+ }
+
+ /**
+ * Helper function to compile and link a program.
+ *
+ * @param vertexShaderHandle An OpenGL handle to an already-compiled vertex shader.
+ * @param fragmentShaderHandle An OpenGL handle to an already-compiled fragment shader.
+ * @param attributes Attributes that need to be bound to the program.
+ * @return An OpenGL handle to the program.
+ */
+ public static int createAndLinkProgram(final int vertexShaderHandle,
final int fragmentShaderHandle,
final String[] attributes) {
- int programHandle = GLES20.glCreateProgram();
-
- if (programHandle != 0) {
- // Bind the vertex shader to the program.
- GLES20.glAttachShader(programHandle, vertexShaderHandle);
-
- // Bind the fragment shader to the program.
- GLES20.glAttachShader(programHandle, fragmentShaderHandle);
-
- // Bind attributes
- if (attributes != null) {
- final int size = attributes.length;
- for (int i = 0; i < size; i++) {
- GLES20.glBindAttribLocation(programHandle, i, attributes[i]);
- }
- }
-
- // Link the two shaders together into a program.
- GLES20.glLinkProgram(programHandle);
-
- // Get the link status.
- final int[] linkStatus = new int[1];
- GLES20.glGetProgramiv(programHandle, GLES20.GL_LINK_STATUS, linkStatus, 0);
-
- // If the link failed, delete the program.
- if (linkStatus[0] == 0) {
- Log.e(TAG, "Error compiling program: " + GLES20.glGetProgramInfoLog(programHandle));
- GLES20.glDeleteProgram(programHandle);
- programHandle = 0;
- }
- }
-
- if (programHandle == 0) {
- throw new RuntimeException("Error creating program.");
- }
-
- return programHandle;
- }
+ int programHandle = GLES20.glCreateProgram();
+
+ if (programHandle != 0) {
+ // Bind the vertex shader to the program.
+ GLES20.glAttachShader(programHandle, vertexShaderHandle);
+
+ // Bind the fragment shader to the program.
+ GLES20.glAttachShader(programHandle, fragmentShaderHandle);
+
+ // Bind attributes
+ if (attributes != null) {
+ final int size = attributes.length;
+ for (int i = 0; i < size; i++) {
+ GLES20.glBindAttribLocation(programHandle, i, attributes[i]);
+ }
+ }
+
+ // Link the two shaders together into a program.
+ GLES20.glLinkProgram(programHandle);
+
+ // Get the link status.
+ final int[] linkStatus = new int[1];
+ GLES20.glGetProgramiv(programHandle, GLES20.GL_LINK_STATUS, linkStatus, 0);
+
+ // If the link failed, delete the program.
+ if (linkStatus[0] == 0) {
+ Log.e(TAG, "Error compiling program: " + GLES20.glGetProgramInfoLog(programHandle));
+ GLES20.glDeleteProgram(programHandle);
+ programHandle = 0;
+ }
+ }
+
+ if (programHandle == 0) {
+ throw new RuntimeException("Error creating program.");
+ }
+
+ return programHandle;
+ }
}
diff --git a/library/src/main/java/com/yalantis/starwars/utils/gl/TextureHelper.java b/library/src/main/java/com/yalantis/starwars/utils/gl/TextureHelper.java
index 3f9342f..71598f9 100644
--- a/library/src/main/java/com/yalantis/starwars/utils/gl/TextureHelper.java
+++ b/library/src/main/java/com/yalantis/starwars/utils/gl/TextureHelper.java
@@ -4,8 +4,6 @@
import android.opengl.GLES20;
import android.opengl.GLUtils;
-import timber.log.Timber;
-
import static android.opengl.GLES20.GL_CLAMP_TO_EDGE;
import static android.opengl.GLES20.GL_NEAREST;
import static android.opengl.GLES20.GL_TEXTURE_2D;
@@ -43,7 +41,6 @@ public static int loadTexture(final Bitmap bitmap) {
int errorCode = GLES20.glGetError();
String errorString = GLUtils.getEGLErrorString(errorCode);
RuntimeException e = new RuntimeException(errorCode + " " + errorString);
- Timber.e(e, "");
throw e;
}