Skip to content

Commit

Permalink
Merge pull request #157 from Omega-R/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
anton-knyazev authored Sep 6, 2021
2 parents 37a4377 + 749e238 commit 4028afe
Show file tree
Hide file tree
Showing 139 changed files with 1,923 additions and 306 deletions.
29 changes: 0 additions & 29 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 5 additions & 0 deletions .idea/codeStyles/codeStyleConfig.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 9 additions & 7 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
compileSdkVersion rootProject.compileSdkVersion
buildToolsVersion rootProject.buildToolsVersion
defaultConfig {
applicationId "com.omega_r.omegarecyclerview"
minSdkVersion 16
targetSdkVersion 28
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -21,17 +21,19 @@ android {
}

dependencies {
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha02'
implementation 'androidx.appcompat:appcompat:' + rootProject.appcompatVersion
implementation 'com.google.android.material:material:' + rootProject.materialVersion

implementation 'com.github.Omega-R.OmegaIntentBuilder:core:' + rootProject.omegaIntentBuilder
implementation 'com.github.Omega-R.OmegaIntentBuilder:annotations:' + rootProject.omegaIntentBuilder
annotationProcessor 'com.github.Omega-R.OmegaIntentBuilder:processor:' + rootProject.omegaIntentBuilder

api project(':omegarecyclerviewlibs')
implementation project(':omegarecyclerview')
implementation project(':omegarecyclerview_fastscroll')
implementation project(':omegarecyclerview_expandable')

androidTestImplementation('com.android.support.test.espresso:espresso-core:' + rootProject.espressoVersion, {
exclude group: 'com.android.support', module: 'support-annotations'
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name_omega"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.AppCompat.Light">
Expand All @@ -25,7 +25,7 @@
<activity android:name=".expandable_example.core.ExpandableActivity" />
<activity android:name=".expandable_example.support_sticky.DefaultStickyExpandableActivity" />
<activity android:name=".expandable_example.ChooseExpandableActivity" />
<activity android:name=".expandable_example.sticky_groups.StickyGroupsActivity"></activity>
<activity android:name=".fastscroll_example.FastScrollActivity"/>
</application>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import android.view.View;

import com.omega_r.libs.omegaintentbuilder.AppOmegaIntentBuilder;
import com.omega_r.libs.omegaintentbuilder.OmegaIntentBuilder;
import com.omega_r.omegarecyclerview.fastscroll_example.FastScrollActivity;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

Expand All @@ -20,6 +22,7 @@ protected void onCreate(Bundle savedInstanceState) {
findViewById(R.id.button_viewpager).setOnClickListener(this);
findViewById(R.id.button_list_adapter).setOnClickListener(this);
findViewById(R.id.button_expandable_recyclerview).setOnClickListener(this);
findViewById(R.id.button_fastscroll).setOnClickListener(this);
}

/**
Expand All @@ -34,49 +37,47 @@ public void onClick(View view) {
AppOmegaIntentBuilder.from(this)
.appActivities()
.swipeMenuActivity()
.createIntentHandler()
.startActivity();
break;
case R.id.button_sticky_header:
AppOmegaIntentBuilder.from(this)
.appActivities()
.stickyHeaderActivity()
.createIntentHandler()
.startActivity();
break;
case R.id.button_pagination:
AppOmegaIntentBuilder.from(this)
.appActivities()
.paginationActivity()
.createIntentHandler()
.startActivity();
break;
case R.id.button_sections:
AppOmegaIntentBuilder.from(this)
.appActivities()
.sectionsActivity()
.createIntentHandler()
.startActivity();
break;
case R.id.button_viewpager:
AppOmegaIntentBuilder.from(this)
.appActivities()
.viewPagerActivity()
.createIntentHandler()
.startActivity();
break;
case R.id.button_list_adapter:
AppOmegaIntentBuilder.from(this)
.appActivities()
.listAdapterActivity()
.createIntentHandler()
.startActivity();
break;
case R.id.button_expandable_recyclerview:
AppOmegaIntentBuilder.from(this)
.appActivities()
.chooseExpandableActivity()
.createIntentHandler()
.startActivity();
break;
case R.id.button_fastscroll:
OmegaIntentBuilder.from(this)
.activity(FastScrollActivity.class)
.startActivity();
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import android.widget.CompoundButton;
import android.widget.RadioButton;

import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.OmegaExpandableRecyclerView;
import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.animation.ExpandableItemAnimator;
import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.animation.standard_animations.DropDownItemAnimator;
import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.animation.standard_animations.FadeItemAnimator;
import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.data.GroupProvider;
import com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView;
import com.omega_r.libs.omegarecyclerview_expandable.animation.ExpandableItemAnimator;
import com.omega_r.libs.omegarecyclerview_expandable.animation.standard_animations.DropDownItemAnimator;
import com.omega_r.libs.omegarecyclerview_expandable.animation.standard_animations.FadeItemAnimator;
import com.omega_r.libs.omegarecyclerview_expandable.data.GroupProvider;
import com.omega_r.omegarecyclerview.R;

import java.util.Arrays;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import android.view.ViewGroup;
import android.widget.TextView;

import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.OmegaExpandableRecyclerView;
import com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView;
import com.omega_r.omegarecyclerview.R;

public class ExpandableAdapter extends OmegaExpandableRecyclerView.Adapter<QuoteGlobalInfo, Quote> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import androidx.annotation.Nullable;

import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.data.GroupProvider;

import com.omega_r.libs.omegarecyclerview_expandable.data.GroupProvider;

import java.util.Arrays;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import android.widget.Toast;

import com.omega_r.libs.omegarecyclerview.OmegaRecyclerView;
import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.OmegaExpandableRecyclerView;
import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.data.ExpandableViewData;
import com.omega_r.libs.omegarecyclerview.sticky_decoration.StickyAdapter;
import com.omega_r.libs.omegarecyclerview.sticky_decoration.HeaderStickyDecoration;
import com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView;
import com.omega_r.libs.omegarecyclerview_expandable.data.ExpandableViewData;
import com.omega_r.omegarecyclerview.R;
import com.omega_r.omegarecyclerview.expandable_example.core.Quote;
import com.omega_r.omegarecyclerview.expandable_example.core.QuoteGlobalInfo;
Expand Down Expand Up @@ -44,6 +44,11 @@ public void onBindStickyViewHolder(StickyViewHolder viewHolder, int position) {
viewHolder.bind(getItem(position).getGroup().getYear());
}

@Override
public void onClickStickyViewHolder(long id) {
// nothing
}

class ExGroupViewHolder extends GroupViewHolder {

private TextView textView;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.omega_r.omegarecyclerview.expandable_example.support_sticky;

import com.omega_r.libs.omegarecyclerview.expandable_recycler_view.OmegaExpandableRecyclerView;
import com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView;
import com.omega_r.omegarecyclerview.expandable_example.core.ExpandableActivity;

import omega.com.annotations.OmegaActivity;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.omega_r.omegarecyclerview.fastscroll_example;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.RecyclerView;

import com.omega_r.omegarecyclerview.R;

public class FastScrollActivity extends AppCompatActivity {

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_fastscroll);
RecyclerView recyclerView = findViewById(R.id.recyclerview);
recyclerView.setAdapter(new FastScrollAdapter());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.omega_r.omegarecyclerview.fastscroll_example;

import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.omega_r.libs.omegarecyclerview.OmegaRecyclerView;
import com.omega_r.omegarecyclerview.R;

public class FastScrollAdapter extends OmegaRecyclerView.Adapter<FastScrollAdapter.ViewHolder> implements
com.omega_r.libs.omegarecyclerview_fastscroll.FastScrollAdapter.Text {

@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
return new ViewHolder(parent);
}

@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
holder.textView.setText(String.valueOf(position));
}

@Override
public int getItemCount() {
return 50;
}

@Override
public String getText(int position) {
return String.valueOf(position);
}

@Override
public long getFastScrollGroupId(int position) {
return position;
}

class ViewHolder extends OmegaRecyclerView.ViewHolder {

final TextView textView;

ViewHolder(ViewGroup parent) {
super(parent, R.layout.item_text);
textView = findViewById(R.id.text_item);
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.Toast;

import com.omega_r.libs.omegarecyclerview.OmegaRecyclerView;
import com.omega_r.libs.omegarecyclerview.sticky_decoration.StickyAdapter;
Expand All @@ -14,9 +15,11 @@ public class StickyHeaderAdapter extends OmegaRecyclerView.Adapter<StickyHeaderA
implements StickyAdapter<StickyHeaderAdapter.HeaderHolder> {

private LayoutInflater mInflater;
private final Context mContext;

public StickyHeaderAdapter(Context context) {
mInflater = LayoutInflater.from(context);
mContext = context;
}

@Override
Expand Down Expand Up @@ -51,12 +54,23 @@ public void onBindStickyViewHolder(HeaderHolder viewHolder, int position) {
viewHolder.header.setText("Header " + getStickyId(position));
}

@Override
public void onClickStickyViewHolder(long id) {
Toast.makeText(mContext, "onClickStickyViewHolder " + id, Toast.LENGTH_SHORT).show();
}

static class ViewHolder extends OmegaRecyclerView.ViewHolder {
public TextView item;

public ViewHolder(View itemView) {
super(itemView);
item = (TextView) itemView;
item.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(v.getContext(), "Clicked", Toast.LENGTH_SHORT).show();
}
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_expandable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

</RadioGroup>

<com.omega_r.libs.omegarecyclerview.expandable_recycler_view.OmegaExpandableRecyclerView
<com.omega_r.libs.omegarecyclerview_expandable.OmegaExpandableRecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
Loading

0 comments on commit 4028afe

Please sign in to comment.