mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-06-30 21:04:16 +00:00
add project adins
This commit is contained in:
parent
ad06ac5505
commit
f8f85d679d
5299 changed files with 625430 additions and 0 deletions
|
@ -0,0 +1,82 @@
|
|||
package com.adins.mss.base.loyalti.userhelpdummy;
|
||||
|
||||
import android.app.Activity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.GridView;
|
||||
|
||||
import com.adins.mss.base.R;
|
||||
import com.adins.mss.base.loyalti.mypointdashboard.DashboardMyPoint;
|
||||
import com.adins.mss.base.loyalti.mypointdashboard.DashboardMyPointItemRecyclerViewAdapter;
|
||||
import com.adins.mss.base.loyalti.mypointdashboard.GridDashBoardAdapter;
|
||||
import com.adins.mss.base.loyalti.mypointdashboard.TeamMember;
|
||||
import com.adins.mss.dummy.userhelp_dummy.UserHelpGeneralDummy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class DashboardMyPointItemDummyAdapter extends RecyclerView.Adapter<DashboardMyPointItemDummyAdapter.ViewHolder> {
|
||||
|
||||
private final Activity mContext;
|
||||
RecyclerView recyclerViewDashBoard;
|
||||
DashboardMyPointItemRecyclerViewAdapter adapter;
|
||||
public DashboardMyPointItemDummyAdapter(Activity context, RecyclerView recyclerView, DashboardMyPointItemRecyclerViewAdapter adapter) {
|
||||
this.recyclerViewDashBoard = recyclerView;
|
||||
mContext = context;
|
||||
this.adapter = adapter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext())
|
||||
.inflate(R.layout.fragment_my_point, parent, false);
|
||||
return new ViewHolder(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, int position) {
|
||||
ArrayList<TeamMember.DataGroupRank> dataGroupRank = new ArrayList<>();
|
||||
TeamMember.DataGroupRank dummyGroupRank1 = new TeamMember().new DataGroupRank();
|
||||
dummyGroupRank1.setLEVEL("LEVEL 1");
|
||||
dummyGroupRank1.setRANK("1");
|
||||
dummyGroupRank1.setRANK_BEFORE("5");
|
||||
|
||||
TeamMember.DataGroupRank dummyGroupRank2 = new TeamMember().new DataGroupRank();
|
||||
dummyGroupRank2.setLEVEL("LEVEL 2");
|
||||
dummyGroupRank2.setRANK("1");
|
||||
dummyGroupRank2.setRANK_BEFORE("10");
|
||||
|
||||
TeamMember.DataGroupRank dummyGroupRank3 = new TeamMember().new DataGroupRank();
|
||||
dummyGroupRank3.setLEVEL("LEVEL 3");
|
||||
dummyGroupRank3.setRANK("6");
|
||||
dummyGroupRank3.setRANK_BEFORE("15");
|
||||
|
||||
dataGroupRank.add(dummyGroupRank1);
|
||||
dataGroupRank.add(dummyGroupRank2);
|
||||
dataGroupRank.add(dummyGroupRank3);
|
||||
|
||||
GridDashBoardAdapter dashBoardAdapter = new GridDashBoardAdapter(mContext , dataGroupRank);
|
||||
holder.gridView.setAdapter(dashBoardAdapter);
|
||||
|
||||
UserHelpGeneralDummy userHelpSvyDummy = new UserHelpGeneralDummy();
|
||||
userHelpSvyDummy.showDetailKompetisi(mContext, DashboardMyPoint.class.getSimpleName(), this.recyclerViewDashBoard, this.adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||
public final View mView;
|
||||
public final GridView gridView;
|
||||
|
||||
public ViewHolder(View view) {
|
||||
super(view);
|
||||
mView = view;
|
||||
gridView = (GridView) view.findViewById(R.id.gridview);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* Copyright 2013 Chris Banes
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package uk.co.senab.actionbarpulltorefresh.library.sdk;
|
||||
|
||||
import android.animation.ValueAnimator;
|
||||
import android.view.View;
|
||||
|
||||
class CompatV11 {
|
||||
|
||||
static void setAlpha(View view, float alpha) {
|
||||
view.setAlpha(alpha);
|
||||
}
|
||||
|
||||
static void postOnAnimation(View view, Runnable runnable) {
|
||||
view.postDelayed(runnable, ValueAnimator.getFrameDelay());
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/image_header"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/ny_light" />
|
|
@ -0,0 +1,151 @@
|
|||
package com.github.jjobes.slidedatetimepicker;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Parcelable;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import com.adins.mss.base.R;
|
||||
|
||||
|
||||
/**
|
||||
* A custom {@link ViewPager} implementation that corrects
|
||||
* the height of the ViewPager and also dispatches touch events to either the ViewPager
|
||||
* or the date or time picker depending on the direction of the swipe.
|
||||
*
|
||||
* @author jjobes
|
||||
*/
|
||||
public class CustomViewPager extends ViewPager {
|
||||
private DatePicker mDatePicker;
|
||||
private TimePicker mTimePicker;
|
||||
private float x1, y1, x2, y2;
|
||||
private float mTouchSlop;
|
||||
|
||||
public CustomViewPager(Context context) {
|
||||
super(context);
|
||||
|
||||
init(context);
|
||||
}
|
||||
|
||||
public CustomViewPager(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
|
||||
init(context);
|
||||
}
|
||||
|
||||
private void init(Context context) {
|
||||
mTouchSlop = ViewConfiguration.get(context).getScaledPagingTouchSlop();
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting wrap_content on a ViewPager's layout_height in XML
|
||||
* doesn't seem to be recognized and the ViewPager will fill the
|
||||
* height of the screen regardless. We'll force the ViewPager to
|
||||
* have the same height as its immediate child.
|
||||
* <p>
|
||||
* Thanks to alexrainman for the bugfix!
|
||||
*/
|
||||
@Override
|
||||
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
||||
int height = 0;
|
||||
|
||||
for (int i = 0; i < getChildCount(); i++) {
|
||||
View child = getChildAt(i);
|
||||
child.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
|
||||
int h = child.getMeasuredHeight();
|
||||
if (h > height)
|
||||
height = h;
|
||||
}
|
||||
|
||||
if (height == 0) {
|
||||
height = Resources.getSystem().getDisplayMetrics().heightPixels;
|
||||
}
|
||||
|
||||
heightMeasureSpec = MeasureSpec.makeMeasureSpec(height, MeasureSpec.EXACTLY);
|
||||
|
||||
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
|
||||
|
||||
mDatePicker = (DatePicker) findViewById(R.id.datePicker);
|
||||
mTimePicker = (TimePicker) findViewById(R.id.timePicker);
|
||||
}
|
||||
|
||||
/**
|
||||
* When the user swipes their finger horizontally, dispatch
|
||||
* those touch events to the ViewPager. When they swipe
|
||||
* vertically, dispatch those touch events to the date or
|
||||
* time picker (depending on which page we're currently on).
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent event) {
|
||||
switch (event.getAction()) {
|
||||
case MotionEvent.ACTION_DOWN:
|
||||
x1 = event.getX();
|
||||
y1 = event.getY();
|
||||
|
||||
break;
|
||||
|
||||
case MotionEvent.ACTION_MOVE:
|
||||
x2 = event.getX();
|
||||
y2 = event.getY();
|
||||
|
||||
if (isScrollingHorizontal(x1, y1, x2, y2)) {
|
||||
// When the user is scrolling the ViewPager horizontally,
|
||||
// block the pickers from scrolling vertically.
|
||||
return super.dispatchTouchEvent(event);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// As long as the ViewPager isn't scrolling horizontally,
|
||||
// dispatch the event to the DatePicker or TimePicker,
|
||||
// depending on which page the ViewPager is currently on.
|
||||
|
||||
switch (getCurrentItem()) {
|
||||
case 0:
|
||||
|
||||
if (mDatePicker != null)
|
||||
mDatePicker.dispatchTouchEvent(event);
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
if (mTimePicker != null)
|
||||
mTimePicker.dispatchTouchEvent(event);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// need this for the ViewPager to scroll horizontally at all
|
||||
return super.onTouchEvent(event);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine whether the distance between the user's ACTION_DOWN
|
||||
* event (x1, y1) and the current ACTION_MOVE event (x2, y2) should
|
||||
* be interpreted as a horizontal swipe.
|
||||
*
|
||||
* @param x1
|
||||
* @param y1
|
||||
* @param x2
|
||||
* @param y2
|
||||
* @return
|
||||
*/
|
||||
private boolean isScrollingHorizontal(float x1, float y1, float x2, float y2) {
|
||||
float deltaX = x2 - x1;
|
||||
float deltaY = y2 - y1;
|
||||
|
||||
return Math.abs(deltaX) > mTouchSlop &&
|
||||
Math.abs(deltaX) > Math.abs(deltaY);
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_focused="true" >
|
||||
<shape>
|
||||
<gradient
|
||||
android:startColor="#ffffff"
|
||||
android:endColor="#ffffff"
|
||||
android:angle="90" />
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="@color/tv_normal" />
|
||||
<corners
|
||||
android:radius="0dp" />
|
||||
<padding
|
||||
android:left="10dp"
|
||||
android:top="10dp"
|
||||
android:right="10dp"
|
||||
android:bottom="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<gradient
|
||||
android:startColor="#ffffff"
|
||||
android:endColor="#ffffff"
|
||||
android:angle="90" />
|
||||
<stroke
|
||||
android:width="2dp"
|
||||
android:color="#7d7d7d"/>
|
||||
<corners
|
||||
android:radius="0dp" />
|
||||
<padding
|
||||
android:left="10dp"
|
||||
android:top="10dp"
|
||||
android:right="10dp"
|
||||
android:bottom="10dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -0,0 +1,17 @@
|
|||
package com.adins.mss.base.timeline;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
|
||||
import com.adins.mss.dao.Timeline;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by kusnendi.muhamad on 26/07/2017.
|
||||
*/
|
||||
|
||||
public interface TimelineListener {
|
||||
public void onSuccessBackgroundTask(List<Timeline> timelines);
|
||||
|
||||
public void onSuccessImageBitmap(Bitmap bitmap, int imageViewId, int defaultImage);
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="14dp"
|
||||
android:height="14dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/gradient_end"
|
||||
android:pathData="M18,2h-8L4.02,8 4,20c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2L20,4c0,-1.1 -0.9,-2 -2,-2zM12,8h-2L10,4h2v4zM15,8h-2L13,4h2v4zM18,8h-2L16,4h2v4z"/>
|
||||
</vector>
|
Loading…
Add table
Add a link
Reference in a new issue