Comments (9)
Sorry.. this is my code:
--------------------------Layout-------------------------------------------
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="56dp" />
<eu.long1.spacetablayout.SpaceTabLayout
android:id="@+id/spaceTabLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_behavior="eu.long1.spacetablayout.SpaceTabLayoutBehavior"
app:number_of_tabs="three"
app:starting_position="one"
app:button_color="@android:color/holo_red_dark"
app:text_one=""
app:text_two=""
app:text_three=""
app:icon_one="@android:drawable/ic_menu_add"
app:icon_two="@android:drawable/ic_menu_add"
app:icon_three="@android:drawable/ic_menu_add"/>-->
</android.support.design.widget.CoordinatorLayout>
---------------------------------------------------------------------MainActivity-------------------
package es.urjc.mov.vromero.spacetab;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import java.util.ArrayList;
import java.util.List;
import eu.long1.spacetablayout.SpaceTabLayout;
public class MainActivity extends AppCompatActivity {
SpaceTabLayout tabLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//add the fragments you want to display in a List
List<Fragment> fragmentList = new ArrayList<>();
fragmentList.add(new FragmentA());
fragmentList.add(new FragmentA());
fragmentList.add(new FragmentA());
ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
tabLayout = (SpaceTabLayout) findViewById(R.id.spaceTabLayout);
//we need the savedInstanceState to get the position
tabLayout.initialize(viewPager, getSupportFragmentManager(),
fragmentList, savedInstanceState);
}
//we need the outState to save the position
@Override
protected void onSaveInstanceState(Bundle outState) {
tabLayout.saveState(outState);
super.onSaveInstanceState(outState);
}
}
from spacetablayout.
You have "-->" at the end of the "<eu.long1.spacetablayout.SpaceTabLayout> tag.
from spacetablayout.
If it is because I was doing tests, but if I delete it happens the same
from spacetablayout.
did you copy the source or used gradle dependency?
from spacetablayout.
It's very strange it worked out well for me this month and on Friday I got this bug and it does not load anything
-----APP------
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "es.urjc.mov.vromero.spacetab"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.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.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'eu.long1:spacetablayout:1.0.4'
testCompile 'junit:junit:4.12'
}
-----PROJECT-----
// 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.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
from spacetablayout.
try to clean the project and try again. Open the terminal in the root folder and type gradle clean then hit enter. What version of Android Studio do you have?
from spacetablayout.
I just tried with version 1.0.3 and everything ok !!
from spacetablayout.
glad, have a good day
from spacetablayout.
Already tried clean project but nothing
Ok , thank you!!!!
from spacetablayout.
Related Issues (20)
- Four & five icon not changed HOT 2
- How to add Badge View In Item Icon๏ผ
- How to add gradient color to the layout ?
- Four Tabs + Text
- Icons are big
- How to set button text/title below the icons?
- Three tab text possition HOT 2
- Icon overlaping
- tablayout initialize error after click other fragment then back to tablayout fragment
- Add more tabs !! HOT 2
- Vertical Usage
- Crash with PlaceAutocompleteListener after go from tab>3 to tab <3
- problem with icon size HOT 2
- How to send data from Activity to Fragment?
- spaceTabLayout initialize issue in kotlin and how use spaceTabLayout in kotlin
- How to disable swipe scrolling between tabs
- forcestop when theres a lib for ads
- Cannot create more than 3 tabs HOT 1
- how to set vertically in layout?
- Fragment and icon cannot be set dynamically
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spacetablayout.