Git Product home page Git Product logo

java-jiahongfei-viewgroupdemo's Introduction

ViewGroupDemo

新闻客户端详情页,上面WebView新闻内容,下面ListView评论,可以上下滑动,类似今日头条,搜狐新闻等

#####介绍 上面展示文章内容用WebView下面展示这个文章的评论用ListView,可以上下滑动来切换文章内容和评论,程序已经发布,经过测试拿来即用

#####扩展 只要实现了IBaseArticleLayout和IBaseCommentLayout接口将这两个View放到ArticleDetailsViewGroup容器中可以自定义其他的上下切换的控件

#####使用方法 MainActivity.java
public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    //一下两个Layout分别实现了IBaseArticleLayout和IBaseCommentLayout接口
    ArticleDetailsLayout articleDetailsLayout = new ArticleDetailsLayout(this);
    ArticleCommentLayout articleCommentLayout = new ArticleCommentLayout(this);

    ArticleDetailsViewGroup articleDetailsViewGroup = (ArticleDetailsViewGroup)findViewById(R.id.articleDetailsViewGroup);

    articleDetailsViewGroup.addArticleView(articleDetailsLayout);
    articleDetailsViewGroup.addCommentView(articleCommentLayout);
    articleDetailsViewGroup.requestLayout();
}

}

activity_main.xml

<com.groupviewrolling.ArticleDetailsViewGroup
    android:id="@+id/articleDetailsViewGroup"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:visibility="visible" >
</com.groupviewrolling.ArticleDetailsViewGroup>

java-jiahongfei-viewgroupdemo's People

Contributors

jiahongfei avatar

Watchers

 avatar

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.