Skip to content

Commit

Permalink
Merge branch 'release/v5.2.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Nov 2, 2015
2 parents b3ea128 + 9e11b74 commit 3d7cae1
Show file tree
Hide file tree
Showing 9 changed files with 135 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ You can find anything you search for in the wiki. (If not open an issue)
The AboutLibraries Library is pushed to [Maven Central](http://search.maven.org/#search|ga|1|g%3A%22com.mikepenz%22), so you just need to add the following dependency to your `build.gradle`. It seems it is also required to add the support dependencies to the application. If it works without, you should be fine too :).

```javascript
compile('com.mikepenz:aboutlibraries:5.2.6@aar') {
compile('com.mikepenz:aboutlibraries:5.2.7@aar') {
transitive = true
}
```
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=5.2.6
VERSION_CODE=526
VERSION_NAME=5.2.7
VERSION_CODE=527
GROUP=com.mikepenz

POM_DESCRIPTION=AboutLibraries Library
Expand Down
4 changes: 2 additions & 2 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
defaultConfig {
minSdkVersion 10
targetSdkVersion 23
versionCode 526
versionName '5.2.6'
versionCode 527
versionName '5.2.7'
}

buildTypes {
Expand Down
44 changes: 40 additions & 4 deletions library/src/main/java/com/mikepenz/aboutlibraries/LibsBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.animation.LayoutAnimationController;

import com.mikepenz.aboutlibraries.entity.Library;
import com.mikepenz.aboutlibraries.ui.LibsActivity;
Expand Down Expand Up @@ -378,7 +379,7 @@ public LibsBuilder withLibraryModification(String library, Libs.LibraryFields mo
}

/**
* Builder method to set the listener for the AboutLibraries actions
* Builder method to set the LibsListener for the AboutLibraries actions
*
* @param libsListener the listener to be notified
* @return
Expand All @@ -388,9 +389,44 @@ public LibsBuilder withListener(LibsConfiguration.LibsListener libsListener) {
return this;
}

/*
* START OF THE FINAL METHODS
*/
/**
* Builder method to set the LibsRecyclerViewListener for the AboutLibraries recyclerView elements
*
* @param recyclerViewListener
* @return
*/
public LibsBuilder withLibsRecyclerViewListener(LibsConfiguration.LibsRecyclerViewListener recyclerViewListener) {
LibsConfiguration.getInstance().setLibsRecyclerViewListener(recyclerViewListener);
return this;
}


/**
* Builder method to set the LibsUIListener for the AboutLibraries view to hook into the view creation
*
* @param uiListener
* @return
*/
public LibsBuilder withUiListener(LibsConfiguration.LibsUIListener uiListener) {
LibsConfiguration.getInstance().setUiListener(uiListener);
return this;
}

/**
* Builder method to set the LayoutAnimationController for the RecyclerView
*
* @param layoutAnimationController
* @return
*/
public LibsBuilder withLayoutAnimationController(LayoutAnimationController layoutAnimationController) {
LibsConfiguration.getInstance().setLayoutAnimationController(layoutAnimationController);
return this;
}

/*
* START OF THE FINAL METHODS
*/


private void preCheck() {
if (fields == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.view.animation.LayoutAnimationController;

import com.mikepenz.aboutlibraries.entity.Library;
import com.mikepenz.aboutlibraries.ui.adapter.LibsRecyclerViewAdapter;

/**
* Created by mikepenz on 20.05.15.
Expand All @@ -26,44 +27,59 @@ public static LibsConfiguration getInstance() {
/**
* LOGIC FOR THE LISTENER
*/
private LibsListener listener = null;
private LibsListener mListener = null;

public void setListener(LibsListener libsListener) {
this.listener = libsListener;
this.mListener = libsListener;
}

public LibsListener getListener() {
return listener;
return mListener;
}

public void removeListener() {
this.listener = null;
this.mListener = null;
}


private LibsUIListener uiListener = null;
private LibsUIListener mUiListener = null;

public LibsUIListener getUiListener() {
return uiListener;
return mUiListener;
}

public void setUiListener(LibsUIListener uiListener) {
this.uiListener = uiListener;
this.mUiListener = uiListener;
}

public void removeUiListener() {
this.uiListener = null;
this.mUiListener = null;
}


private LayoutAnimationController layoutAnimationController = null;
private LibsRecyclerViewListener mRecyclerViewListener = null;

public LibsRecyclerViewListener getLibsRecyclerViewListener() {
return mRecyclerViewListener;
}

public void setLibsRecyclerViewListener(LibsRecyclerViewListener recyclerViewListener) {
this.mRecyclerViewListener = recyclerViewListener;
}

public void removeLibsRecyclerViewListener() {
this.mRecyclerViewListener = null;
}


private LayoutAnimationController mLayoutAnimationController = null;

public LayoutAnimationController getLayoutAnimationController() {
return layoutAnimationController;
return mLayoutAnimationController;
}

public void setLayoutAnimationController(LayoutAnimationController layoutAnimationController) {
this.layoutAnimationController = layoutAnimationController;
this.mLayoutAnimationController = layoutAnimationController;
}

/**
Expand All @@ -76,11 +92,39 @@ public void reset() {


public interface LibsUIListener {
/**
* PreOnCreateView method called before the view was created
*
* @param view
* @return
*/
View preOnCreateView(View view);

/**
* PostOnCreateView method called after the view was created
*
* @param view
* @return
*/
View postOnCreateView(View view);
}

public interface LibsRecyclerViewListener {
/**
* OnBindHeaderViewHolder called after the headerView was filled inside the recyclerViews onBindViewHolder method
*
* @param headerViewHolder
*/
void OnBindViewHolder(LibsRecyclerViewAdapter.HeaderViewHolder headerViewHolder);

/**
* OnBindViewHolder called after the item view was filled inside the recyclerViews onBindViewHolder method
*
* @param headerViewHolder
*/
void OnBindViewHolder(LibsRecyclerViewAdapter.ViewHolder headerViewHolder);
}

public interface LibsListener {
/**
* onClick listener if the icon of the AboutAppSection is clicked
Expand Down Expand Up @@ -165,6 +209,16 @@ public interface LibsListener {
boolean onLibraryBottomLongClicked(View v, Library library);
}

public abstract class LibsRecyclerViewListenerImpl implements LibsRecyclerViewListener {
@Override
public void OnBindViewHolder(LibsRecyclerViewAdapter.HeaderViewHolder headerViewHolder) {
}

@Override
public void OnBindViewHolder(LibsRecyclerViewAdapter.ViewHolder headerViewHolder) {
}
}

public abstract class LibsListenerImpl implements LibsListener {
@Override
public void onIconClicked(View v) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class LibsFragment extends Fragment {

private Comparator<Library> comparator;

private AsyncTask mLibTask;

/**
* Default Constructor
* Gets an libs instance and gets all external libs
Expand Down Expand Up @@ -229,7 +231,16 @@ public void onViewCreated(View view, Bundle savedInstanceState) {
//load the data
if (getContext() != null) {
//fill the fragment with the content
new LibraryTask(getContext()).execute();
mLibTask = new LibraryTask(getContext()).execute();
}
}

@Override
public void onDestroyView() {
super.onDestroyView();
if (mLibTask != null) {
mLibTask.cancel(true);
mLibTask = null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ public void onClick(View v) {
if (!libsBuilder.aboutShowIcon && !libsBuilder.aboutShowVersion || TextUtils.isEmpty(libsBuilder.aboutDescription)) {
holder.aboutDivider.setVisibility(View.GONE);
}

//notify the libsRecyclerViewListener to allow modifications
if (LibsConfiguration.getInstance().getLibsRecyclerViewListener() != null) {
LibsConfiguration.getInstance().getLibsRecyclerViewListener().OnBindViewHolder(holder);
}
} else if (viewHolder instanceof ViewHolder) {
ViewHolder holder = (ViewHolder) viewHolder;

Expand Down Expand Up @@ -341,6 +346,11 @@ public boolean onLongClick(View v) {
holder.libraryBottomContainer.setOnLongClickListener(null);

}

//notify the libsRecyclerViewListener to allow modifications
if (LibsConfiguration.getInstance().getLibsRecyclerViewListener() != null) {
LibsConfiguration.getInstance().getLibsRecyclerViewListener().OnBindViewHolder(holder);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Most modern apps feature an "Used Library"-Section and for this some information of those libs is required. As it gets annoying to copy those strings always to your app I have developed this small helper library to provide the required information.
]]>
</string>
<string name="library_AboutLibraries_libraryVersion">5.2.6</string>
<string name="library_AboutLibraries_libraryVersion">5.2.7</string>
<string name="library_AboutLibraries_libraryWebsite">https://github.com/mikepenz/AboutLibraries</string>
<string name="library_AboutLibraries_licenseId">apache_2_0</string>
<string name="library_AboutLibraries_isOpenSource">true</string>
Expand Down
4 changes: 2 additions & 2 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId 'com.mikepenz.aboutlibraries.sample'
minSdkVersion 11
targetSdkVersion 23
versionCode 526
versionName '5.2.6'
versionCode 527
versionName '5.2.7'

applicationVariants.all { variant ->
variant.outputs.each { output ->
Expand Down

0 comments on commit 3d7cae1

Please sign in to comment.