2015-10-05 92 views
1

嗨,我试图从github实现第三方库。这有点疯狂。我已经与第三方libarys经常合作。我所要做的只是在构建gradle中添加编译命令,但在这种情况下,它有些不同。这是LIB GitHub的链接我想要实现:Android第三方集成

Link to github

的问题是我不能够访问这个库的所有组件。只有到了文件com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.0:[email protected]

但在类ExpandableExampleActivity我必须导入:

import com.h6ah4i.android.example.advrecyclerview.R; 
import com.h6ah4i.android.example.advrecyclerview.common.data.AbstractExpandableDataProvider; 
import com.h6ah4i.android.example.advrecyclerview.common.fragment.ExampleExpandableDataProviderFragment; 

,但我不能。我可以看到github上的目录中的文件!

有人可以帮助我如何整合这个最好的方法。 THX

buildscript { 
    repositories { 
     maven { url 'https://raw.github.com/xujiaao/mvn-repository/master/releases' } 
    } 

    dependencies { 
     classpath 'com.github.xujiaao:aarLinkSources:1.0.0' 
    } 
} 

apply plugin: 'com.android.application' 
apply plugin: 'aar-link-sources' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.0 rc3" 

    defaultConfig { 
     applicationId "android.oli.com.fitnessapp" 
     minSdkVersion 16 
     targetSdkVersion 21 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:23.0.1' 
    compile 'com.android.support:design:23.0.1' 
    compile 'com.android.support:recyclerview-v7:23.0.1' 
    compile 'com.android.support:cardview-v7:23.0.1' 
    compile 'com.github.sundeepk:compact-calendar-view:1.7.8' 

    compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:[email protected]'){ 
     transitive=true 
    } 
    aarLinkSources 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.0:[email protected]' 
} 
+0

这实际上是关于“R包方和递归分区partykit”? –

+0

什么?我不明白这一点。我只想成功整合整个图书馆。 – XxGoliathusxX

+0

XxGoliathusxX:您指定了“派对”标签,其摘要包含引用的@AndyTurner文本。 (我已经删除了标签。) – fadden

回答

1

至于我看到,如果你只需要导入的三个文件,

import com.h6ah4i.android.example.advrecyclerview.R; 
import com.h6ah4i.android.example.advrecyclerview.common.data.AbstractExpandableDataProvider; 
import com.h6ah4i.android.example.advrecyclerview.common.fragment.ExampleExpandableDataProviderFragment; 

然后刚刚从GitHub的项目最后两个文件复制到自己。 R文件将在构建项目时自动生成。我没有看到这两个文件依赖于其他文件,所以它应该工作。

+0

就像我说:我没有访问到com.h6ah4i.android.EXAMPLE。而上面的输入只是例子。我需要更多。 – XxGoliathusxX

+0

伙计,它在github文件夹中,我有权访问,所以你应该也有! – varunkr

+0

其全部标记为红色灰色。当我进口东西,写一个。没有示例 – XxGoliathusxX