Skip to content

Commit

Permalink
updated to androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
tirgei committed Oct 25, 2018
1 parent b4732cc commit 04b0a64
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/src/main/java/com/gelostech/viewpager/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.gelostech.viewpager

import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.design.widget.TabLayout
import androidx.appcompat.app.AppCompatActivity
import com.gelostech.viewpager.fragments.FragmentOne
import com.gelostech.viewpager.fragments.FragmentThree
import com.gelostech.viewpager.fragments.FragmentTwo
import com.google.android.material.tabs.TabLayout
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
Expand Down
9 changes: 5 additions & 4 deletions app/src/main/java/com/gelostech/viewpager/PagerAdapter.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.gelostech.viewpager;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

/**
* Created by Monroe on 7/13/2016.
*/
Expand All @@ -20,7 +21,7 @@ public class PagerAdapter extends FragmentPagerAdapter {



public PagerAdapter(FragmentManager fm,Context context) {
public PagerAdapter(FragmentManager fm, Context context) {
super(fm);
this.context = context;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package com.gelostech.viewpager.fragments


import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment

import com.gelostech.viewpager.R

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package com.gelostech.viewpager.fragments


import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment

import com.gelostech.viewpager.R

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package com.gelostech.viewpager.fragments


import android.os.Bundle
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.Fragment

import com.gelostech.viewpager.R

Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,26 @@
android:layout_height="match_parent"
tools:context=".MainActivity">

<android.support.design.widget.AppBarLayout
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.v7.widget.Toolbar
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways" />

<android.support.design.widget.TabLayout
<com.google.android.material.tabs.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabGravity="fill"
app:tabMode="fixed" />

</android.support.design.widget.AppBarLayout>
</com.google.android.material.appbar.AppBarLayout>

<com.gelostech.nonswipableviewpager.NonSwipeableViewPager
android:id="@+id/viewpager"
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
android.useAndroidX=true
android.enableJetifier=true
# 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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package com.gelostech.nonswipableviewpager;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.animation.DecelerateInterpolator;
import android.widget.Scroller;

import java.lang.reflect.Field;

import androidx.viewpager.widget.ViewPager;

public class NonSwipeableViewPager extends ViewPager {

public NonSwipeableViewPager(Context context) {
Expand Down

0 comments on commit 04b0a64

Please sign in to comment.