diff --git a/.gitignore b/.gitignore index f5353c24fd58995cb9e01f4ebda600c363c82d16..37a4eb8b43d978ea05b2c6e3fb934f9b40dddd4d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,15 @@ -# Created by .ignore support plugin (hsz.mobi) -### Android template -# Built application files -*.apk -*.ap_ - -# Files for the ART/Dalvik VM -*.dex - -# Generated files -bin/ -gen/ -out/ - -# Gradle files -.gradle/ - -# Local configuration file (sdk path, etc) -local.properties - -# Intellij *.iml -.idea/ +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store /build -/app/build -/fabrevealmenu/build +/captures +.externalNativeBuild +/entry/.preview +.cxx diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..6e6b3e4d1f99940b2dcd9b166367cd72eafa9987 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,4 @@ +## 0.0.1-SNAPSHOT +* ohos 第一个版本 +* 实现了原库的大部分 api +* 因为ViewCompat.setTransitionName()方法无替代方案,导致转场揭露动画效果没有实现 diff --git a/README.OPENSOURCE b/README.OPENSOURCE new file mode 100644 index 0000000000000000000000000000000000000000..24659443a514cd5048d89358d1d75a2c6c11b599 --- /dev/null +++ b/README.OPENSOURCE @@ -0,0 +1,10 @@ +[ + { + "Name": " FABRevealMenu ", + "License": " Apache License ", + "License File": " LICENSE ", + "Version Number": " 2.0.0 ", + "Upstream URL": " https://github.com/HarinTrivedi/FABRevealMenu-master ", + "Description": " An simple general purpose UI library to create custom user defied menu in modern way with your favourite Floating action button " + } +] diff --git a/README.md b/README.md index 0c36739867b7cc5dcd5427db922728c9eec73e3f..2faa64f544fdff9bc546e851cc3444ab6600a4ec 100644 --- a/README.md +++ b/README.md @@ -1,119 +1,95 @@ -# FABRevealMenu 2.0 ✌️ -*** -An simple general purpose UI library to create custom user defied menu in modern way with your favourite Floating action button. It incorporates lollipop circular reveal view with cool animations somewhat inspired from google material design guideline - -Uses [Material Container Transformation](https://material.io/develop/android/theming/motion#container-transform) from material components by Google. -*** - -gradle dependency: - -Step 1. Add it in your root build.gradle at the end of repositories: - -```` +# FABRevealMenu 2.0 +#### 项目介绍 +- 项目名称:FABRevealMenu +- 所属系列:OpenHarmony的第三方组件适配移植 +- 功能:代码块高亮显示。 +- 项目移植状态:完成 +- 调用差异:无 +- 开发版本:sdk5,DevEco Studio2.1 Beta4 +- 基线版本:FABRevealMenu组件 Release 2.0.0 + +#### 效果演示 +![img](gif/fabmenu.gif) + +#### 安装教程 +1.在项目根目录下的build.gradle文件中, +```gradle allprojects { - repositories { - ... - maven { url 'https://jitpack.io' } - } + repositories { + maven { + url 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + } + } } -```` -Step 2. Add the dependency - -```` -compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -.... - +``` +2.在entry模块的build.gradle文件中, +```gradle dependencies { - implementation 'com.github.HarinTrivedi:FABRevealMenu-master:2.0.0' + implementation('com.gitee.chinasoft_ohos:FABRevealMenu:0.0.1-SNAPSHOT') + ...... } - -```` - - -## What's new: -* Vector icon support -* Font support -* Disable menut item -* Set menu corder radius -* Set custom animation duration - -## Demo -* Horizontal Menu - -![demo_horizontal](https://i.imgur.com/238nJX7.gif) - -* Vertical Menu - -![demo_vertical](https://i.imgur.com/OQwH1ls.gif) - -* Custom view in Menu - -![demo_custom](https://i.imgur.com/FMrFoHs.gif) - -*** -## How to use -* By xml - -Add namespace in layout like: - - xmlns:app="http://schemas.android.com/apk/res-auto" - -Use FABRevealMenu in xml layout like: - - - - - -* By Code - -All attributes can also be set/altered by below methods: - -```` - setMenu(@MenuRes) // set R.menu resourece + app:menuDirection="left" + app:menuSize="normal" + app:menuTitleFontFamily="huakangshaonv.ttf" + app:menuTitleTextColor="$color:colorWhite" + app:showOverlay="true" + app:menuCornerRadius="15vp" + app:showTitle="true" /> + ``` + +2. 在java中使用: + ```java setMenuItems(ArrayList) // set custom menu items - setOverlayBackground(@ColorRes) // change default overlay background color - setMenuBackground(@ColorRes) // change menu background color + setOverlayBackground($ColorRes) // change default overlay background color + setMenuBackground($ColorRes) // change menu background color setShowOverlay(boolean) // change overlay visibility : be careful to use this setTitleVisible(boolean) // set menu item title visibility - setMenuTitleTextColor(@ColorRes) // change menu item text color + setMenuTitleTextColor($ColorRes) // change menu item text color setMenuDirection(Direction) // change menu direction when showed : place FAB on screen properly to change directions setSmallerMenu() // small size menu setNormalMenu() // normal size menu - setMenuTitleDisabledTextColor(@ColorRes) // set disable text color - setMenuTitleTypeface(@FontRes) // set custom font typeface + setMenuTitleDisabledTextColor($ ColorRes) // set disable text color + setMenuTitleTypeface(String) // set custom font typeface + ``` + +3. 设置自定义View + ```xml + app:menuCustomView="$layoutRes" + ``` + ```java + setCustomView(Component) + ``` -```` +#### 测试信息 + +CodeCheck代码测试无异常 -* Set custom view +CloudTest代码测试无异常 -You can inflate custom view by two ways +火绒安全病毒安全检测通过 -1. **app:menuCustomView="@layoutRes"** // you can get custom view object by calling getCustomView() on fabRevealMenu instance +当前版本demo功能与原组件基本无差异 -2. **setCustomView(View)** -*** +#### 版本迭代 -## LICENSE +- 0.0.1-SNAPSHOT + +#### 版权和许可信息 ```` Copyright 2020 Harry's Lab @@ -127,5 +103,4 @@ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and -limitations under the License. -```` +limitat diff --git a/_config.yml b/_config.yml deleted file mode 100644 index b84971359435a0abab28bcc56d7b0ce2f0f9911f..0000000000000000000000000000000000000000 --- a/_config.yml +++ /dev/null @@ -1 +0,0 @@ -theme: jekyll-theme-leap-day \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100755 index c96e6a14c637ad54e74afe462e41a8df3a62a79e..0000000000000000000000000000000000000000 --- a/app/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' - -android { - compileSdkVersion 29 - - defaultConfig { - applicationId "com.hlabexamples.fabrevealmenu" - minSdkVersion 21 - targetSdkVersion 29 - versionCode 1 - versionName "1.0.0" - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation 'com.google.android.material:material:1.2.0' - implementation project(':fabrevealmenu') - implementation "androidx.core:core-ktx:+" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} -repositories { - mavenCentral() -} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro deleted file mode 100755 index 6f69dd2cb44decac1a5660ab2db02731f8f1259a..0000000000000000000000000000000000000000 --- a/app/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in /Volumes/DATA/Android-Setup/android-sdk-mac_86/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml deleted file mode 100755 index f1b8849a639a29613d3094579b874074ac63e061..0000000000000000000000000000000000000000 --- a/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/java/com/hlabexamples/fabrevealmenu/BaseFragment.java b/app/src/main/java/com/hlabexamples/fabrevealmenu/BaseFragment.java deleted file mode 100755 index e3eb74d91958de2d00c5fed79725e876230b16bd..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/hlabexamples/fabrevealmenu/BaseFragment.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.hlabexamples.fabrevealmenu; - - -import androidx.fragment.app.Fragment; - -import com.hlab.fabrevealmenu.view.FABRevealMenu; - -/** - * A simple {@link Fragment} subclass. - */ -public class BaseFragment extends Fragment { - - private FABRevealMenu fabMenu; - - public boolean onBackPressed() { - if (fabMenu != null) { - if (fabMenu.isShowing()) { - fabMenu.closeMenu(); - return false; - } - } - return true; - } - - public FABRevealMenu getFabMenu() { - return fabMenu; - } - - public void setFabMenu(FABRevealMenu fabMenu) { - this.fabMenu = fabMenu; - } -} diff --git a/app/src/main/java/com/hlabexamples/fabrevealmenu/DemoCodeFragment.java b/app/src/main/java/com/hlabexamples/fabrevealmenu/DemoCodeFragment.java deleted file mode 100755 index 5e370d031e3657719d3f604148ab70f1f2dcc68d..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/hlabexamples/fabrevealmenu/DemoCodeFragment.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.hlabexamples.fabrevealmenu; - -import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import com.google.android.material.floatingactionbutton.FloatingActionButton; - -import androidx.core.content.res.ResourcesCompat; -import androidx.appcompat.content.res.AppCompatResources; - -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.CheckBox; -import android.widget.Spinner; -import android.widget.Toast; - -import com.hlab.fabrevealmenu.helper.Direction; -import com.hlab.fabrevealmenu.helper.OnFABMenuSelectedListener; -import com.hlab.fabrevealmenu.model.FABMenuItem; -import com.hlab.fabrevealmenu.view.FABRevealMenu; - -import java.util.ArrayList; -import java.util.Objects; - -public class DemoCodeFragment extends BaseFragment implements OnFABMenuSelectedListener { - - private ArrayList items; - private String[] mDirectionStrings = {"LEFT", "UP"}; - private Direction currentDirection = Direction.LEFT; - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - return inflater.inflate(R.layout.fragment_code, container, false); - } - - @Override - public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - initItems(false); - - final FABRevealMenu fabMenu = initFabMenu(view); - - initListeners(view, fabMenu); - } - - private FABRevealMenu initFabMenu(@NonNull View view) { - FloatingActionButton fab = view.findViewById(R.id.fab); - final FABRevealMenu fabMenu = view.findViewById(R.id.fabMenu); - - try { - if (fab != null && fabMenu != null) { - //attach menu to fab - setFabMenu(fabMenu); - //set menu items from arrylist - fabMenu.setMenuItems(items); - //attach menu to fab - fabMenu.bindAnchorView(fab); - //set menu item selection - fabMenu.setOnFABMenuSelectedListener(this); - } - } catch (Exception e) { - e.printStackTrace(); - } - return fabMenu; - } - - private void initListeners(@NonNull View view, FABRevealMenu fabMenu) { - CheckBox cbTitle = view.findViewById(R.id.chTitle); - cbTitle.setOnCheckedChangeListener((compoundButton, b) -> { - if (fabMenu != null) { - fabMenu.setTitleVisible(b); - } - }); - CheckBox cbShowOverlay = view.findViewById(R.id.chOverlay); - cbShowOverlay.setOnCheckedChangeListener((compoundButton, b) -> { - if (fabMenu != null) { - fabMenu.setShowOverlay(b); - } - }); - CheckBox cbDouble = view.findViewById(R.id.chDouble); - cbDouble.setOnCheckedChangeListener((compoundButton, b) -> { - if (fabMenu != null) { - initItems(b); - fabMenu.setMenuItems(items); - } - }); - CheckBox cbFont = view.findViewById(R.id.chFont); - cbFont.setOnCheckedChangeListener((compoundButton, b) -> { - if (fabMenu != null) { - //set custom font typeface - fabMenu.setMenuTitleTypeface(ResourcesCompat.getFont(Objects.requireNonNull(getActivity()), R.font.quicksand)); - } - }); - CheckBox chSmall = view.findViewById(R.id.chSmall); - chSmall.setOnCheckedChangeListener((compoundButton, isSmaller) -> { - if (fabMenu != null) { - if (isSmaller) - fabMenu.setSmallerMenu(); - else - fabMenu.setNormalMenu(); - } - }); - Spinner spDirections = view.findViewById(R.id.spDirection); - spDirections.setAdapter(new ArrayAdapter<>(Objects.requireNonNull(getActivity()), android.R.layout.simple_spinner_dropdown_item, mDirectionStrings)); - spDirections.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { - @Override - public void onItemSelected(AdapterView adapterView, View view, int position, long l) { - if (fabMenu != null) { - if (position == 0 && currentDirection != Direction.LEFT) { - currentDirection = Direction.LEFT; - fabMenu.setMenuDirection(Direction.LEFT); - } else if (position == 1 && currentDirection != Direction.UP) { - currentDirection = Direction.UP; - fabMenu.setMenuDirection(Direction.UP); - } - } - } - - @Override - public void onNothingSelected(AdapterView adapterView) { - if (fabMenu != null) { - fabMenu.setMenuDirection(Direction.LEFT); - } - } - }); - } - - private void initItems(boolean toShowDoubleItems) { - items = new ArrayList<>(); - items.add(new FABMenuItem("Attachments", AppCompatResources.getDrawable(Objects.requireNonNull(getActivity()), R.drawable.ic_attachment))); - items.add(new FABMenuItem("Images", AppCompatResources.getDrawable(getActivity(), R.drawable.ic_image))); - items.add(new FABMenuItem("Places", AppCompatResources.getDrawable(getActivity(), R.drawable.ic_place))); - items.add(new FABMenuItem("Emoticons", AppCompatResources.getDrawable(getActivity(), R.drawable.ic_emoticon))); - if (toShowDoubleItems) { - items.add(new FABMenuItem("Attachments", AppCompatResources.getDrawable(getActivity(), R.drawable.ic_attachment))); - items.add(new FABMenuItem("Images", AppCompatResources.getDrawable(getActivity(), R.drawable.ic_image))); - items.add(new FABMenuItem("Places", AppCompatResources.getDrawable(getActivity(), R.drawable.ic_place))); - items.add(new FABMenuItem("Emoticons", AppCompatResources.getDrawable(getActivity(), R.drawable.ic_emoticon))); - } - } - - @Override - public void onMenuItemSelected(View view, int id) { - if (id >= 0 && items != null && items.size() > id) { - Toast.makeText(getActivity(), items.get(id).getTitle() + "Clicked", Toast.LENGTH_SHORT).show(); - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/hlabexamples/fabrevealmenu/DemoXmlFragment.java b/app/src/main/java/com/hlabexamples/fabrevealmenu/DemoXmlFragment.java deleted file mode 100755 index c3a3aa4983af7554f92a66a651c2245255144995..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/hlabexamples/fabrevealmenu/DemoXmlFragment.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.hlabexamples.fabrevealmenu; - -import android.os.Bundle; - -import androidx.annotation.NonNull; -import androidx.annotation.Nullable; - -import com.google.android.material.floatingactionbutton.FloatingActionButton; - -import android.view.LayoutInflater; -import android.view.View; -import android.view.ViewGroup; -import android.widget.AdapterView; -import android.widget.ArrayAdapter; -import android.widget.Spinner; -import android.widget.Toast; - -import com.hlab.fabrevealmenu.helper.Direction; -import com.hlab.fabrevealmenu.helper.OnFABMenuSelectedListener; -import com.hlab.fabrevealmenu.view.FABRevealMenu; - -public class DemoXmlFragment extends BaseFragment implements OnFABMenuSelectedListener { - - private String[] mDirectionStrings = {"LEFT", "UP"}; - private Direction currentDirection = Direction.LEFT; - - @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState) { - return inflater.inflate(R.layout.fragment_xml, container, false); - } - - @Override - public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { - super.onViewCreated(view, savedInstanceState); - - final FABRevealMenu fabMenu = initFabMenu(view); - - initListeners(view, fabMenu); - } - - private FABRevealMenu initFabMenu(View view) { - final FloatingActionButton fab = view.findViewById(R.id.fab); - final FABRevealMenu fabMenu = view.findViewById(R.id.fabMenu); - - try { - if (fab != null && fabMenu != null) { - setFabMenu(fabMenu); - //attach menu to fab - fabMenu.bindAnchorView(fab); - //set menu selection listener - fabMenu.setOnFABMenuSelectedListener(this); - } - } catch (Exception e) { - e.printStackTrace(); - } - return fabMenu; - } - - private void initListeners(View view, FABRevealMenu fabMenu) { - Spinner spDirections = view.findViewById(R.id.spDirection); - spDirections.setAdapter(new ArrayAdapter<>(getActivity(), android.R.layout.simple_spinner_dropdown_item, mDirectionStrings)); - spDirections.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { - @Override - public void onItemSelected(AdapterView adapterView, View view, int position, long l) { - if (fabMenu != null) { - if (position == 0 && currentDirection != Direction.LEFT) { - currentDirection = Direction.LEFT; - fabMenu.setMenuDirection(Direction.LEFT); - } else if (position == 1 && currentDirection != Direction.UP) { - currentDirection = Direction.UP; - fabMenu.setMenuDirection(Direction.UP); - } - } - } - - @Override - public void onNothingSelected(AdapterView adapterView) { - if (fabMenu != null) { - fabMenu.setMenuDirection(Direction.LEFT); - } - } - }); - } - - @Override - public void onMenuItemSelected(View view, int id) { - if (id == R.id.menu_attachment) { - Toast.makeText(getActivity(), "Attachment Selected", Toast.LENGTH_SHORT).show(); - } else if (id == R.id.menu_image) { - Toast.makeText(getActivity(), "Image Selected", Toast.LENGTH_SHORT).show(); - } else if (id == R.id.menu_place) { - Toast.makeText(getActivity(), "Place Selected", Toast.LENGTH_SHORT).show(); - } else if (id == R.id.menu_emoticon) { - Toast.makeText(getActivity(), "Emoticon Selected", Toast.LENGTH_SHORT).show(); - } - } -} \ No newline at end of file diff --git a/app/src/main/java/com/hlabexamples/fabrevealmenu/MainActivity.java b/app/src/main/java/com/hlabexamples/fabrevealmenu/MainActivity.java deleted file mode 100644 index 3b06ce21998505bcbb031915fad2f51febf52279..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/hlabexamples/fabrevealmenu/MainActivity.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.hlabexamples.fabrevealmenu; - -import android.content.Intent; -import android.os.Bundle; - -import androidx.annotation.NonNull; - -import com.google.android.material.bottomnavigation.BottomNavigationView; - -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; - -import android.view.MenuItem; - -public class MainActivity extends AppCompatActivity implements BottomNavigationView.OnNavigationItemSelectedListener { - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - Toolbar toolbar = findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - BottomNavigationView navigation = findViewById(R.id.navigation); - navigation.setOnNavigationItemSelectedListener(this); - - showXmlFragment(); - - } - - @Override - public boolean onNavigationItemSelected(@NonNull MenuItem item) { - // Handle navigation view item clicks here. - int id = item.getItemId(); - - if (id == R.id.nav_xml) { - showXmlFragment(); - return true; - } else if (id == R.id.nav_code) { - showCodeFragment(); - return true; - } else if (id == R.id.nav_custom) { - Intent intent = new Intent(MainActivity.this, ScrollingActivity.class); - startActivity(intent); - return true; - } - return false; - } - - private void showXmlFragment() { - getSupportFragmentManager().beginTransaction().replace(R.id.container, new DemoXmlFragment()).commit(); - } - - private void showCodeFragment() { - getSupportFragmentManager().beginTransaction().replace(R.id.container, new DemoCodeFragment()).commit(); - } - -} diff --git a/app/src/main/java/com/hlabexamples/fabrevealmenu/ScrollingActivity.java b/app/src/main/java/com/hlabexamples/fabrevealmenu/ScrollingActivity.java deleted file mode 100755 index 8896a8cb197dff0c8feaab32c3e70017852c21d5..0000000000000000000000000000000000000000 --- a/app/src/main/java/com/hlabexamples/fabrevealmenu/ScrollingActivity.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.hlabexamples.fabrevealmenu; - -import android.os.Bundle; - -import com.google.android.material.floatingactionbutton.FloatingActionButton; - -import androidx.appcompat.app.AppCompatActivity; -import androidx.appcompat.widget.Toolbar; - -import android.view.MenuItem; -import android.view.View; -import android.widget.Button; -import android.widget.CheckBox; -import android.widget.Toast; - -import com.hlab.fabrevealmenu.view.FABRevealMenu; - -import java.util.Objects; - -public class ScrollingActivity extends AppCompatActivity { - FABRevealMenu fabMenu; - - @Override - public void onBackPressed() { - if (fabMenu.isShowing()) - fabMenu.closeMenu(); - else - super.onBackPressed(); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_scrolling); - Toolbar toolbar = findViewById(R.id.toolbar); - setSupportActionBar(toolbar); - - Objects.requireNonNull(getSupportActionBar()).setDisplayShowHomeEnabled(true); - getSupportActionBar().setDisplayHomeAsUpEnabled(true); - - final FloatingActionButton fab = findViewById(R.id.fab); - fabMenu = findViewById(R.id.fabMenu); - - try { - if (fab != null && fabMenu != null) { - - View customView = View.inflate(this, R.layout.layout_custom_menu, null); - setupCustomFilterView(customView); - fabMenu.setCustomView(customView); - fabMenu.bindAnchorView(fab); - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - - private void setupCustomFilterView(View customView) { - if (customView != null) { - Button btnApply = customView.findViewById(R.id.btnApply); - CheckBox cb1 = customView.findViewById(R.id.cb1); - CheckBox cb2 = customView.findViewById(R.id.cb2); - CheckBox cb3 = customView.findViewById(R.id.cb3); - CheckBox cb4 = customView.findViewById(R.id.cb4); - - final CheckBox[] filters = new CheckBox[]{cb1, cb2, cb3, cb4}; - - btnApply.setOnClickListener(view -> { - fabMenu.closeMenu(); - StringBuilder builder = new StringBuilder("Selected:"); - for (CheckBox filter : filters) { - if (filter.isChecked()) { - builder.append("\n").append(filter.getText().toString()); - } - } - Toast.makeText(ScrollingActivity.this, builder.toString(), Toast.LENGTH_SHORT).show(); - }); - } - - } - - @Override - public boolean onOptionsItemSelected(MenuItem item) { - if (item.getItemId() == android.R.id.home) - finish(); - return super.onOptionsItemSelected(item); - } -} diff --git a/app/src/main/res/drawable/ic_attachment.xml b/app/src/main/res/drawable/ic_attachment.xml deleted file mode 100644 index 7e43cc91a2d2642f1e42e09b4cf4c78a8d0fa600..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_attachment.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_code.xml b/app/src/main/res/drawable/ic_code.xml deleted file mode 100644 index 5bd4000d647996adda90f54f6dcd9d22ad1ada8a..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_code.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_design.xml b/app/src/main/res/drawable/ic_design.xml deleted file mode 100644 index 871d6ea6ba0aca459dce911a39cb489dba1774de..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_design.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_emoticon.xml b/app/src/main/res/drawable/ic_emoticon.xml deleted file mode 100644 index 118e8a850c0c7fa37ea90bf2fa1e12fcb8e3516f..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_emoticon.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_hand.xml b/app/src/main/res/drawable/ic_hand.xml deleted file mode 100644 index 030dbb59067ee6a629e7db7e9d0668d13beea9df..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_hand.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_image.xml b/app/src/main/res/drawable/ic_image.xml deleted file mode 100644 index e454be8353c9a9ead2dc7939f0f4ece547162ed7..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_image.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_menu.xml b/app/src/main/res/drawable/ic_menu.xml deleted file mode 100644 index 065079329046742a1ed3c54832c50b145f75eb18..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_menu.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_place.xml b/app/src/main/res/drawable/ic_place.xml deleted file mode 100644 index fa6efd9a13a49e7022988c2e6809e29db189422a..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/ic_place.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml deleted file mode 100755 index 18d28cfec195f3e5faadecc108653592e1fcefa1..0000000000000000000000000000000000000000 --- a/app/src/main/res/drawable/side_nav_bar.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml deleted file mode 100644 index e4b1d45e7171b23a3f937bffd153e2072ad0900f..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_main.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/layout/activity_scrolling.xml b/app/src/main/res/layout/activity_scrolling.xml deleted file mode 100755 index e99365797b279953099d984e36c97dbb50aaa631..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/activity_scrolling.xml +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml deleted file mode 100755 index 779a75c01631e8281474048d4c457274746ac540..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/app_bar_main.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/content_scrolling.xml b/app/src/main/res/layout/content_scrolling.xml deleted file mode 100755 index 97aa5cbc5eda679ae4e844934942de2c0571d104..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/content_scrolling.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - diff --git a/app/src/main/res/layout/fragment_code.xml b/app/src/main/res/layout/fragment_code.xml deleted file mode 100755 index dc1639b1a1a15c5f916ad065999a4f416f65da47..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/fragment_code.xml +++ /dev/null @@ -1,143 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/fragment_xml.xml b/app/src/main/res/layout/fragment_xml.xml deleted file mode 100755 index 4ca1f9cbac556a9cc62c9c99b3d7334d0c61d8af..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/fragment_xml.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/layout/layout_custom_menu.xml b/app/src/main/res/layout/layout_custom_menu.xml deleted file mode 100755 index c4f259a5288730358a6ac3ee28580c7f10b6acd3..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/layout_custom_menu.xml +++ /dev/null @@ -1,97 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml deleted file mode 100755 index 2e82465d3237320937f3fd9325e3c129fc299aca..0000000000000000000000000000000000000000 --- a/app/src/main/res/layout/nav_header_main.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - diff --git a/app/src/main/res/menu/bottom_menu.xml b/app/src/main/res/menu/bottom_menu.xml deleted file mode 100755 index f926e67b7160eb5d26fe3a0277ffac74a0ededf8..0000000000000000000000000000000000000000 --- a/app/src/main/res/menu/bottom_menu.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - diff --git a/app/src/main/res/menu/menu_fab.xml b/app/src/main/res/menu/menu_fab.xml deleted file mode 100755 index f9438618381a0a2679d59f8cd8db87bf2600f2ef..0000000000000000000000000000000000000000 --- a/app/src/main/res/menu/menu_fab.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100755 index cde69bcccec65160d92116f20ffce4fce0b5245c..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100755 index c133a0cbd379f5af6dbf1a899a0293ca5eccfad0..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100755 index bfa42f0e7b91d006d22352c9ff2f134e504e3c1d..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100755 index 324e72cdd7480cb983fa1bcc7ce686e51ef87fe7..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100755 index aee44e138434630332d88b1680f33c4b24c70ab3..0000000000000000000000000000000000000000 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml deleted file mode 100755 index 6ed0e7b50f792b63ea35c1d4ecdf77321130db30..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/colors.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - #1976d2 - #145391 - #1976d2 - diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml deleted file mode 100755 index 0afe4ccfe8ae6796e9386ec58a7953aed3eb85af..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/dimens.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - 16dp - 16dp - 16dp - 220dp - 16dp - - 16dp - 160dp - diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml deleted file mode 100755 index 96006b931d54f49a5bbc9664a6d18581a1358537..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/strings.xml +++ /dev/null @@ -1,117 +0,0 @@ - - FABRevealMenu - ScrollingActivity - - This fragment shows xml configuration of FabRevealMenu with horizontal orientation. Play with different layout attributes to customize the experience - This fragment shows dynamic configuration of FabRevealMenu with dynamic menu item creation. - - Show Title - Show More Items - Show Overlay - Change Direction : - - Custom font - Smaller menu - Animate - - (To use \'RIGHT\' and \'DOWN\' directions, you are recommended to place your FAB at proper place on screen) - - - "Material is the metaphor.\n\n" - - "A material metaphor is the unifying theory of a rationalized space and a system of motion." - "The material is grounded in tactile reality, inspired by the study of paper and ink, yet " - "technologically advanced and open to imagination and magic.\n" - "Surfaces and edges of the material provide visual cues that are grounded in reality. The " - "use of familiar tactile attributes helps users quickly understand affordances. Yet the " - "flexibility of the material creates new affordances that supercede those in the physical " - "world, without breaking the rules of physics.\n" - "The fundamentals of light, surface, and movement are key to conveying how objects move, " - "interact, and exist in space and in relation to each other. Realistic lighting shows " - "seams, divides space, and indicates moving parts.\n\n" - - "Bold, graphic, intentional.\n\n" - - "The foundational elements of print based design typography, grids, space, scale, color, " - "and use of imagery guide visual treatments. These elements do far more than please the " - "eye. They create hierarchy, meaning, and focus. Deliberate color choices, edge to edge " - "imagery, large scale typography, and intentional white space create a bold and graphic " - "interface that immerse the user in the experience.\n" - "An emphasis on user actions makes core functionality immediately apparent and provides " - "waypoints for the user.\n\n" - - "Motion provides meaning.\n\n" - - "Motion respects and reinforces the user as the prime mover. Primary user actions are " - "inflection points that initiate motion, transforming the whole design.\n" - "All action takes place in a single environment. Objects are presented to the user without " - "breaking the continuity of experience even as they transform and reorganize.\n" - "Motion is meaningful and appropriate, serving to focus attention and maintain continuity. " - "Feedback is subtle yet clear. Transitions are efficient yet coherent.\n\n" - - "3D world.\n\n" - - "The material environment is a 3D space, which means all objects have x, y, and z " - "dimensions. The z-axis is perpendicularly aligned to the plane of the display, with the " - "positive z-axis extending towards the viewer. Every sheet of material occupies a single " - "position along the z-axis and has a standard 1dp thickness.\n" - "On the web, the z-axis is used for layering and not for perspective. The 3D world is " - "emulated by manipulating the y-axis.\n\n" - - "Light and shadow.\n\n" - - "Within the material environment, virtual lights illuminate the scene. Key lights create " - "directional shadows, while ambient light creates soft shadows from all angles.\n" - "Shadows in the material environment are cast by these two light sources. In Android " - "development, shadows occur when light sources are blocked by sheets of material at " - "various positions along the z-axis. On the web, shadows are depicted by manipulating the " - "y-axis only. The following example shows the card with a height of 6dp.\n\n" - - "Resting elevation.\n\n" - - "All material objects, regardless of size, have a resting elevation, or default elevation " - "that does not change. If an object changes elevation, it should return to its resting " - "elevation as soon as possible.\n\n" - - "Component elevations.\n\n" - - "The resting elevation for a component type is consistent across apps (e.g., FAB elevation " - "does not vary from 6dp in one app to 16dp in another app).\n" - "Components may have different resting elevations across platforms, depending on the depth " - "of the environment (e.g., TV has a greater depth than mobile or desktop).\n\n" - - "Responsive elevation and dynamic elevation offsets.\n\n" - - "Some component types have responsive elevation, meaning they change elevation in response " - "to user input (e.g., normal, focused, and pressed) or system events. These elevation " - "changes are consistently implemented using dynamic elevation offsets.\n" - "Dynamic elevation offsets are the goal elevation that a component moves towards, relative " - "to the component’s resting state. They ensure that elevation changes are consistent " - "across actions and component types. For example, all components that lift on press have " - "the same elevation change relative to their resting elevation.\n" - "Once the input event is completed or cancelled, the component will return to its resting " - "elevation.\n\n" - - "Avoiding elevation interference.\n\n" - - "Components with responsive elevations may encounter other components as they move between " - "their resting elevations and dynamic elevation offsets. Because material cannot pass " - "through other material, components avoid interfering with one another any number of ways, " - "whether on a per component basis or using the entire app layout.\n" - "On a component level, components can move or be removed before they cause interference. " - "For example, a floating action button (FAB) can disappear or move off screen before a " - "user picks up a card, or it can move if a snackbar appears.\n" - "On the layout level, design your app layout to minimize opportunities for interference. " - "For example, position the FAB to one side of stream of a cards so the FAB won’t interfere " - "when a user tries to pick up one of cards.\n\n" - - - - open_drawer - close_drawer - Main2Activity - Home - Dashboard - Notifications - - diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml deleted file mode 100755 index 2395d7df0495ad04c9c31a1558a457a8fc3bbc89..0000000000000000000000000000000000000000 --- a/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - -