Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions StarWars.iml

This file was deleted.

11 changes: 8 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,26 @@

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
}
}

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

Expand Down
34 changes: 19 additions & 15 deletions demo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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"
}
Expand All @@ -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
}
}
127 changes: 0 additions & 127 deletions demo/demo.iml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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.
*/
Expand All @@ -26,12 +23,11 @@ public class ProfileAdapter extends RecyclerView.Adapter<ProfileAdapter.ViewHold
private static final int VIEW_TYPE_TEXT_FIELD = 1;
private static final int VIEW_GENDER_FIELD = 2;
private final ProfileAdapterListener mListener;
private User mUser;

private final String mFullNameLabel;
private final String mHomeWorldLabel;
private final String mBirthdayLabel;
private final String mGenderLabel;
private User mUser;

public ProfileAdapter(Context context, User user, ProfileAdapterListener listener) {
mUser = user;
Expand Down Expand Up @@ -123,21 +119,15 @@ public int getItemCount() {
}

public class ViewHolder extends RecyclerView.ViewHolder {
@Nullable
@Bind(R.id.side_switch)
BackgroundDrawableSwitchCompat mySwitch;

@Nullable
@Bind(R.id.tv_label)
TextView label;

@Nullable
@Bind(R.id.tv_value)
TextView value;

public ViewHolder(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
mySwitch = itemView.findViewById(R.id.side_switch);
label = itemView.findViewById(R.id.tv_label);
value = itemView.findViewById(R.id.tv_value);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.yalantis.starwarsdemo.interfaces;

import android.support.v7.widget.SwitchCompat;

import androidx.appcompat.widget.SwitchCompat;

/**
* Created by Artem Kholodnyi on 11/17/15.
Expand Down
11 changes: 7 additions & 4 deletions demo/src/main/java/com/yalantis/starwarsdemo/model/User.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.yalantis.starwarsdemo.model;

import android.support.annotation.DrawableRes;
import android.support.annotation.StringRes;

import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;

import com.yalantis.starwarsdemo.R;

Expand All @@ -21,7 +22,8 @@ public User(boolean darkSide, String fullName, String homeworld, String birthday
mBirthday = birthday;
}

public @DrawableRes int getPhotoRes() {
public @DrawableRes
int getPhotoRes() {
return mDarkSide ? R.drawable.darth : R.drawable.anakin;
}

Expand All @@ -41,7 +43,8 @@ public String getBirthday() {
return mBirthday;
}

public @StringRes int getSideText() {
public @StringRes
int getSideText() {
return isDarkSide() ? R.string.dark_side_label : R.string.light_side_label;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentTransaction;

import com.yalantis.starwarsdemo.R;
import com.yalantis.starwarsdemo.interfaces.DemoActivityInterface;
Expand All @@ -19,17 +20,13 @@

import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
* Created by Artem Kholodnyi on 11/11/15.
*/
public class DemoActivity extends AppCompatActivity implements GreetingFragmentInterface,
DemoActivityInterface, TilesRendererInterface {
@Bind(R.id.gl_surface_view)
GLSurfaceView mGlSurfaceView;

private GLSurfaceView mGlSurfaceView;
private SideFragment mDarkFragment;
private SideFragment mBrightFragment;
private GreetingsFragment mGreetingsFragment;
Expand All @@ -39,8 +36,7 @@ protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.activity_demo);
ButterKnife.bind(this);

mGlSurfaceView = findViewById(R.id.gl_surface_view);
// Check if the system supports OpenGL ES 2.0.
final ActivityManager activityManager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
Expand All @@ -61,7 +57,6 @@ protected void onCreate(Bundle savedInstanceState) {
if (savedInstanceState == null) {
showGreetings();
}

}

@Override
Expand Down
Loading