GithubHelp home page GithubHelp logo

bug? about spacetablayout HOT 9 CLOSED

long1eu avatar long1eu commented on August 23, 2024
bug?

from spacetablayout.

Comments (9)

 avatar commented on August 23, 2024

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.

long1eu avatar long1eu commented on August 23, 2024

You have "-->" at the end of the "<eu.long1.spacetablayout.SpaceTabLayout> tag.

from spacetablayout.

 avatar commented on August 23, 2024

If it is because I was doing tests, but if I delete it happens the same

from spacetablayout.

long1eu avatar long1eu commented on August 23, 2024

did you copy the source or used gradle dependency?

from spacetablayout.

 avatar commented on August 23, 2024

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.

long1eu avatar long1eu commented on August 23, 2024

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.

 avatar commented on August 23, 2024

I just tried with version 1.0.3 and everything ok !!

from spacetablayout.

long1eu avatar long1eu commented on August 23, 2024

glad, have a good day

from spacetablayout.

 avatar commented on August 23, 2024

Already tried clean project but nothing

Ok , thank you!!!!

from spacetablayout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.