Toggle navigation
Toggle navigation
This project
Loading...
Sign in
open-source
/
warply_android_sdk_maven_plugin
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Panagiotis Triantafyllou
2023-09-29 15:55:27 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
250f3a37d02c8494519cf2386acf8b4fb31da550
250f3a37
1 parent
27f17454
mfy fixes
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
60 deletions
.idea/misc.xml
warply_android_sdk/build.gradle
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
.idea/misc.xml
View file @
250f3a3
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"DesignSurface"
>
<option
name=
"filePathToZoomLevelMap"
>
...
...
warply_android_sdk/build.gradle
View file @
250f3a3
...
...
@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext
{
PUBLISH_GROUP_ID
=
'ly.warp'
PUBLISH_VERSION
=
'4.5.4.6rc7
5
'
PUBLISH_VERSION
=
'4.5.4.6rc7
6
'
PUBLISH_ARTIFACT_ID
=
'warply-android-sdk'
}
...
...
warply_android_sdk/src/main/java/ly/warp/sdk/activities/MoreForYouActivity.java
View file @
250f3a3
...
...
@@ -23,6 +23,7 @@ import org.json.JSONObject;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Map
;
import
java.util.TreeMap
;
...
...
@@ -235,73 +236,133 @@ public class MoreForYouActivity extends Activity implements View.OnClickListener
mIvBack
.
setOnClickListener
(
this
);
mIvPopupClose
.
setOnClickListener
(
this
);
if
(
mUniqueSectionList
!=
null
)
{
if
(
mUniqueSectionList
.
size
()
==
1
)
{
try
{
String
firstKey
=
(
String
)
mUniqueSectionList
.
keySet
().
toArray
()[
0
];
if
(
mUniqueSectionList
.
get
(
firstKey
)
!=
null
&&
mUniqueSectionList
.
get
(
firstKey
).
size
()
>
0
)
{
mTvResearchSection
.
setText
(
firstKey
.
substring
(
1
));
mResearchItems
.
setNestedScrollingEnabled
(
false
);
mResearchItems
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterResearch
=
new
MoreCampaignAdapter
(
this
,
mUniqueSectionList
.
get
(
firstKey
));
mResearchItems
.
setAdapter
(
mAdapterResearch
);
mAdapterResearch
.
getPositionClicks
()
.
doOnNext
(
this
::
handleMoreItemClick
)
.
doOnError
(
error
->
{
})
.
subscribe
();
mLlResearchItems
.
setVisibility
(
View
.
VISIBLE
);
}
}
catch
(
IndexOutOfBoundsException
ex
)
{
ex
.
printStackTrace
();
if
(
mUniqueSectionList
!=
null
&&
mUniqueSectionList
.
size
()
>
0
)
{
for
(
Map
.
Entry
<
String
,
ArrayList
<
Campaign
>>
set
:
mUniqueSectionList
.
entrySet
())
{
String
itemKey
=
set
.
getKey
();
ArrayList
<
Campaign
>
itemValue
=
set
.
getValue
();
if
(
itemKey
.
contains
(
"1"
))
{
mTvResearchSection
.
setText
(
itemKey
.
substring
(
1
));
mResearchItems
.
setNestedScrollingEnabled
(
false
);
mResearchItems
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterResearch
=
new
MoreCampaignAdapter
(
this
,
itemValue
);
mResearchItems
.
setAdapter
(
mAdapterResearch
);
mAdapterResearch
.
getPositionClicks
()
.
doOnNext
(
this
::
handleMoreItemClick
)
.
doOnError
(
error
->
{
})
.
subscribe
();
mLlResearchItems
.
setVisibility
(
View
.
VISIBLE
);
}
}
if
(
mUniqueSectionList
.
size
()
==
2
)
{
try
{
String
secondKey
=
(
String
)
mUniqueSectionList
.
keySet
().
toArray
()[
1
];
if
(
mUniqueSectionList
.
get
(
secondKey
)
!=
null
&&
mUniqueSectionList
.
get
(
secondKey
).
size
()
>
0
)
{
mTvExclusiveSection
.
setText
(
secondKey
.
substring
(
1
));
mExclusiveItems
.
setNestedScrollingEnabled
(
false
);
mExclusiveItems
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterExclusive
=
new
MoreCampaignAdapter
(
this
,
mUniqueSectionList
.
get
(
secondKey
));
mExclusiveItems
.
setAdapter
(
mAdapterExclusive
);
mAdapterExclusive
.
getPositionClicks
()
.
doOnNext
(
this
::
handleMoreItemClick
)
.
doOnError
(
error
->
{
})
.
subscribe
();
mLlExclusiveItems
.
setVisibility
(
View
.
VISIBLE
);
}
}
catch
(
IndexOutOfBoundsException
ex
)
{
ex
.
printStackTrace
();
for
(
Map
.
Entry
<
String
,
ArrayList
<
Campaign
>>
set
:
mUniqueSectionList
.
entrySet
())
{
String
itemKey
=
set
.
getKey
();
ArrayList
<
Campaign
>
itemValue
=
set
.
getValue
();
if
(
itemKey
.
contains
(
"2"
))
{
mTvExclusiveSection
.
setText
(
itemKey
.
substring
(
1
));
mExclusiveItems
.
setNestedScrollingEnabled
(
false
);
mExclusiveItems
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterExclusive
=
new
MoreCampaignAdapter
(
this
,
itemValue
);
mExclusiveItems
.
setAdapter
(
mAdapterExclusive
);
mAdapterExclusive
.
getPositionClicks
()
.
doOnNext
(
this
::
handleMoreItemClick
)
.
doOnError
(
error
->
{
})
.
subscribe
();
mLlExclusiveItems
.
setVisibility
(
View
.
VISIBLE
);
}
}
if
(
mUniqueSectionList
.
size
()
==
3
)
{
try
{
String
thirdKey
=
(
String
)
mUniqueSectionList
.
keySet
().
toArray
()[
2
];
if
(
mUniqueSectionList
.
get
(
thirdKey
)
!=
null
&&
mUniqueSectionList
.
get
(
thirdKey
).
size
()
>
0
)
{
mTvContestSection
.
setText
(
thirdKey
.
substring
(
1
));
mContestItems
.
setNestedScrollingEnabled
(
false
);
mContestItems
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterContest
=
new
MoreCampaignAdapter
(
this
,
mUniqueSectionList
.
get
(
thirdKey
));
mContestItems
.
setAdapter
(
mAdapterContest
);
mAdapterContest
.
getPositionClicks
()
.
doOnNext
(
this
::
handleMoreItemClick
)
.
doOnError
(
error
->
{
})
.
subscribe
();
mLlContestItems
.
setVisibility
(
View
.
VISIBLE
);
}
}
catch
(
IndexOutOfBoundsException
ex
)
{
ex
.
printStackTrace
();
for
(
Map
.
Entry
<
String
,
ArrayList
<
Campaign
>>
set
:
mUniqueSectionList
.
entrySet
())
{
String
itemKey
=
set
.
getKey
();
ArrayList
<
Campaign
>
itemValue
=
set
.
getValue
();
if
(
itemKey
.
contains
(
"3"
))
{
mTvContestSection
.
setText
(
itemKey
.
substring
(
1
));
mContestItems
.
setNestedScrollingEnabled
(
false
);
mContestItems
.
setLayoutManager
(
new
LinearLayoutManager
(
this
,
LinearLayoutManager
.
VERTICAL
,
false
));
mAdapterContest
=
new
MoreCampaignAdapter
(
this
,
itemValue
);
mContestItems
.
setAdapter
(
mAdapterContest
);
mAdapterContest
.
getPositionClicks
()
.
doOnNext
(
this
::
handleMoreItemClick
)
.
doOnError
(
error
->
{
})
.
subscribe
();
mLlContestItems
.
setVisibility
(
View
.
VISIBLE
);
}
}
// if (mUniqueSectionList.size() == 1) {
// try {
// String firstKey = (String) mUniqueSectionList.keySet().toArray()[0];
// if (mUniqueSectionList.get(firstKey) != null && mUniqueSectionList.get(firstKey).size() > 0) {
// mTvResearchSection.setText(firstKey.substring(1));
// mResearchItems.setNestedScrollingEnabled(false);
// mResearchItems.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
// mAdapterResearch = new MoreCampaignAdapter(this, mUniqueSectionList.get(firstKey));
// mResearchItems.setAdapter(mAdapterResearch);
// mAdapterResearch.getPositionClicks()
// .doOnNext(this::handleMoreItemClick)
// .doOnError(error -> {
// })
// .subscribe();
//
// mLlResearchItems.setVisibility(View.VISIBLE);
// }
// } catch (IndexOutOfBoundsException ex) {
// ex.printStackTrace();
// }
// }
//
// if (mUniqueSectionList.size() == 2) {
// try {
// String secondKey = (String) mUniqueSectionList.keySet().toArray()[1];
// if (mUniqueSectionList.get(secondKey) != null && mUniqueSectionList.get(secondKey).size() > 0) {
// mTvExclusiveSection.setText(secondKey.substring(1));
// mExclusiveItems.setNestedScrollingEnabled(false);
// mExclusiveItems.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
// mAdapterExclusive = new MoreCampaignAdapter(this, mUniqueSectionList.get(secondKey));
// mExclusiveItems.setAdapter(mAdapterExclusive);
// mAdapterExclusive.getPositionClicks()
// .doOnNext(this::handleMoreItemClick)
// .doOnError(error -> {
// })
// .subscribe();
//
// mLlExclusiveItems.setVisibility(View.VISIBLE);
// }
// } catch (IndexOutOfBoundsException ex) {
// ex.printStackTrace();
// }
// }
//
// if (mUniqueSectionList.size() == 3) {
// try {
// String thirdKey = (String) mUniqueSectionList.keySet().toArray()[2];
// if (mUniqueSectionList.get(thirdKey) != null && mUniqueSectionList.get(thirdKey).size() > 0) {
// mTvContestSection.setText(thirdKey.substring(1));
// mContestItems.setNestedScrollingEnabled(false);
// mContestItems.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false));
// mAdapterContest = new MoreCampaignAdapter(this, mUniqueSectionList.get(thirdKey));
// mContestItems.setAdapter(mAdapterContest);
// mAdapterContest.getPositionClicks()
// .doOnNext(this::handleMoreItemClick)
// .doOnError(error -> {
// })
// .subscribe();
//
// mLlContestItems.setVisibility(View.VISIBLE);
// }
// } catch (IndexOutOfBoundsException ex) {
// ex.printStackTrace();
// }
// }
if
(
mContextualList
!=
null
&&
mContextualList
.
size
()
>
0
)
{
mTvContextualSection
.
setText
(
getString
(
R
.
string
.
cos_mfy_other
));
mContextualItems
.
setNestedScrollingEnabled
(
false
);
...
...
Please
register
or
login
to post a comment