Skip to content

Commit

Permalink
--Stable.
Browse files Browse the repository at this point in the history
--Made MainActivity extend AppCompatActivity.
--Removed casting of views.
  • Loading branch information
neri4488 committed Jun 21, 2018
1 parent bb2282b commit acbf37b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
8 changes: 4 additions & 4 deletions demo/src/main/java/com/daimajia/slider/demo/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
Expand All @@ -24,15 +24,15 @@
import java.util.HashMap;


public class MainActivity extends ActionBarActivity implements BaseSliderView.OnSliderClickListener, ViewPagerEx.OnPageChangeListener{
public class MainActivity extends AppCompatActivity implements BaseSliderView.OnSliderClickListener, ViewPagerEx.OnPageChangeListener{

private SliderLayout mDemoSlider;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mDemoSlider = (SliderLayout)findViewById(R.id.slider);
mDemoSlider = findViewById(R.id.slider);

HashMap<String,String> url_maps = new HashMap<String, String>();
url_maps.put("Hannibal", "http://static2.hypable.com/wp-content/uploads/2013/12/hannibal-season-2-release-date.jpg");
Expand Down Expand Up @@ -67,7 +67,7 @@ protected void onCreate(Bundle savedInstanceState) {
mDemoSlider.setCustomAnimation(new DescriptionAnimation());
mDemoSlider.setDuration(4000);
mDemoSlider.addOnPageChangeListener(this);
ListView l = (ListView)findViewById(R.id.transformers);
ListView l = findViewById(R.id.transformers);
l.setAdapter(new TransformerAdapter(this));
l.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
Expand Down
5 changes: 5 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ dependencies {
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation "com.android.support:support-v4:27.1.1"
implementation 'com.squareup.picasso:picasso:2.5.2'
//implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.nineoldandroids:library:2.4.0'

//Added to fix conflicting versions with other libraries
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
}
apply from: './gradle-mvn-push.gradle'
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import android.support.v4.os.ParcelableCompat;
import android.support.v4.os.ParcelableCompatCreatorCallbacks;
import android.support.v4.view.AccessibilityDelegateCompat;
import android.support.v4.view.KeyEventCompat;
import android.support.v4.view.MotionEventCompat;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.VelocityTrackerCompat;
Expand Down Expand Up @@ -2512,17 +2511,6 @@ public boolean executeKeyEvent(KeyEvent event) {
case KeyEvent.KEYCODE_DPAD_RIGHT:
handled = arrowScroll(FOCUS_RIGHT);
break;
case KeyEvent.KEYCODE_TAB:
if (Build.VERSION.SDK_INT >= 11) {
// The focus finder had a bug handling FOCUS_FORWARD and FOCUS_BACKWARD
// before Android 3.0. Ignore the tab key on those devices.
if (KeyEventCompat.hasNoModifiers(event)) {
handled = arrowScroll(FOCUS_FORWARD);
} else if (KeyEventCompat.hasModifiers(event, KeyEvent.META_SHIFT_ON)) {
handled = arrowScroll(FOCUS_BACKWARD);
}
}
break;
}
}
return handled;
Expand Down

0 comments on commit acbf37b

Please sign in to comment.