• 大小: 5.21MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-11-18
  • 语言: Java
  • 标签:

资源简介

android万能遥控器的交互效果源码模仿乐视遥控App添加万能遥控器的交互效果。

资源截图

代码片段和文件信息

package com.weilu.customview;

import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;

import com.ogaclejapan.smarttablayout.SmartTabLayout;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItem;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItemAdapter;
import com.ogaclejapan.smarttablayout.utils.v4.FragmentPagerItems;
import com.weilu.customview.bean.DraggableInfo;
import com.weilu.customview.fragment.DemoFragment;
import com.weilu.customview.fragment.DemoFragment1;
import com.weilu.customview.widget.RemoteControlView;

public class MainActivity extends AppCompatActivity {

    private RemoteControlView remoteControlView;
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ViewPager viewPager = this.findViewById(R.id.viewpager);
        SmartTabLayout viewPagerTab = this.findViewById(R.id.viewpagertab);

        FragmentPagerItems pages = new FragmentPagerItems(this);
        pages.add(FragmentPagerItem.of(“功能键“ DemoFragment.class));
        pages.add(FragmentPagerItem.of(“音量键“ DemoFragment1.class));
        pages.add(FragmentPagerItem.of(“播放键“ DemoFragment.class));
        pages.add(FragmentPagerItem.of(“数字键“ DemoFragment.class));

        FragmentPagerItemAdapter adapter = new FragmentPagerItemAdapter(getSupportFragmentManager() pages);

        viewPager.setAdapter(adapter);
        viewPagerTab.setViewPager(viewPager);

        remoteControlView = this.findViewById(R.id.rcv);
    }
    
    public void setDragInfo(DraggableInfo mButton){
        remoteControlView.setDragInfo(mButton);
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-12-07 03:12  RemoteControlView-master\
     文件          86  2018-12-07 03:12  RemoteControlView-master\.gitignore
     文件       11357  2018-12-07 03:12  RemoteControlView-master\LICENSE
     文件         973  2018-12-07 03:12  RemoteControlView-master\README.md
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\
     文件           7  2018-12-07 03:12  RemoteControlView-master\app\.gitignore
     文件         840  2018-12-07 03:12  RemoteControlView-master\app\build.gradle
     文件         751  2018-12-07 03:12  RemoteControlView-master\app\proguard-rules.pro
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\
     文件         840  2018-12-07 03:12  RemoteControlView-master\app\src\main\AndroidManifest.xml
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\
     文件        1764  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\MainActivity.java
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\adapter\
     文件        2270  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\adapter\MyAdapter.java
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\bean\
     文件        1052  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\bean\DraggableInfo.java
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\fragment\
     文件        3299  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\fragment\DemoFragment.java
     文件        2055  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\fragment\DemoFragment1.java
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\utils\
     文件        1715  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\utils\MyDragShadowBuilder.java
     文件        1345  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\utils\Tools.java
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\widget\
     文件        2590  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\widget\DraggableButton.java
     文件       23533  2018-12-07 03:12  RemoteControlView-master\app\src\main\java\com\weilu\customview\widget\RemoteControlView.java
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\res\
     目录           0  2018-12-07 03:12  RemoteControlView-master\app\src\main\res\drawable-v24\
............此处省略76个文件信息

评论

共有 条评论