mirror of
https://github.com/freeedcom/ai-codereviewer.git
synced 2025-07-01 05:14:17 +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,51 @@
|
|||
package com.adins.mss.foundation.camerainapp.helper;
|
||||
|
||||
import android.animation.ObjectAnimator;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import com.adins.mss.base.util.Interpolator;
|
||||
import com.androidquery.AQuery;
|
||||
|
||||
/**
|
||||
* Created by angga.permadi on 7/27/2016.
|
||||
*/
|
||||
public abstract class BaseLinearLayout extends LinearLayout {
|
||||
protected AQuery query;
|
||||
|
||||
public BaseLinearLayout(Context context) {
|
||||
super(context);
|
||||
inflate(context);
|
||||
|
||||
setId((int) (System.currentTimeMillis() / 1000));
|
||||
|
||||
afterCreate();
|
||||
}
|
||||
|
||||
private void inflate(Context context) {
|
||||
log("on Inflate");
|
||||
View view = inflate(context, getLayoutResId(), this);
|
||||
|
||||
if (query == null) {
|
||||
query = new AQuery(view);
|
||||
} else {
|
||||
query = query.recycle(view);
|
||||
}
|
||||
}
|
||||
|
||||
protected ObjectAnimator createRotateAnimator(final View target, final float from, final float to) {
|
||||
ObjectAnimator animator = ObjectAnimator.ofFloat(target, "rotation", from, to);
|
||||
animator.setDuration(300);
|
||||
animator.setInterpolator(Interpolator.createInterpolator(Interpolator.LINEAR_INTERPOLATOR));
|
||||
return animator;
|
||||
}
|
||||
|
||||
protected abstract void afterCreate();
|
||||
|
||||
protected abstract int getLayoutResId();
|
||||
|
||||
protected void log(String message) {
|
||||
Logger.d(this, message);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.adins.mss.base.dynamicform;
|
||||
|
||||
import com.adins.mss.foundation.http.MssRequestType;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* Created by noerhayati.dm on 8/2/2018.
|
||||
*/
|
||||
|
||||
public class JsonRequestDigitalReceipt extends MssRequestType {
|
||||
|
||||
@SerializedName("uuidUser")
|
||||
private String uuidUser;
|
||||
|
||||
public String getUuidUser() {
|
||||
return uuidUser;
|
||||
}
|
||||
|
||||
public void setUuidUser(String uuidUser) {
|
||||
this.uuidUser = uuidUser;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
Binary file not shown.
After Width: | Height: | Size: 257 B |
|
@ -0,0 +1,56 @@
|
|||
package com.adins.mss.base.timeline;
|
||||
|
||||
public class MenuModel {
|
||||
|
||||
private int icon;
|
||||
private String title;
|
||||
private String counter;
|
||||
|
||||
private boolean isGroupHeader = false;
|
||||
|
||||
public MenuModel(String title) {
|
||||
this(-1, title, null);
|
||||
isGroupHeader = true;
|
||||
}
|
||||
|
||||
public MenuModel(int icon, String title, String counter) {
|
||||
super();
|
||||
this.icon = icon;
|
||||
this.title = title;
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
public int getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setIcon(int icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getCounter() {
|
||||
return counter;
|
||||
}
|
||||
|
||||
public void setCounter(String counter) {
|
||||
this.counter = counter;
|
||||
}
|
||||
|
||||
public boolean isGroupHeader() {
|
||||
return isGroupHeader;
|
||||
}
|
||||
|
||||
public void setGroupHeader(boolean isGroupHeader) {
|
||||
this.isGroupHeader = isGroupHeader;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_enabled="false" >
|
||||
<shape>
|
||||
<!-- <solid
|
||||
android:color="@android:color/darker_gray" /> -->
|
||||
<gradient
|
||||
android:startColor="@color/gradient_start"
|
||||
android:endColor="@color/gradient_end"
|
||||
android:angle="270"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_enabled="true" >
|
||||
<shape>
|
||||
<gradient
|
||||
android:startColor="@color/gradient_start"
|
||||
android:endColor="@color/gradient_end"
|
||||
android:angle="270"
|
||||
/>
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_pressed="true" >
|
||||
<shape>
|
||||
<solid
|
||||
android:color="#4d4d4d" />
|
||||
<!-- <padding -->
|
||||
<!-- android:left="20dp" -->
|
||||
<!-- android:top="20dp" -->
|
||||
<!-- android:right="20dp" -->
|
||||
<!-- android:bottom="20dp" /> -->
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
<shape>
|
||||
<gradient
|
||||
android:startColor="@color/gradient_start"
|
||||
android:endColor="@color/gradient_end"
|
||||
android:angle="270"
|
||||
/>
|
||||
<!-- <padding -->
|
||||
<!-- android:left="20dp" -->
|
||||
<!-- android:top="20dp" -->
|
||||
<!-- android:right="20dp" -->
|
||||
<!-- android:bottom="20dp" /> -->
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (C) 2010 The Android Open Source Project
|
||||
*
|
||||
* 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 com.adins.libs.nineoldandroids.animation;
|
||||
|
||||
/**
|
||||
* This evaluator can be used to perform type interpolation between <code>int</code> values.
|
||||
*/
|
||||
public class IntEvaluator implements TypeEvaluator<Integer> {
|
||||
|
||||
/**
|
||||
* This function returns the result of linearly interpolating the start and end values, with
|
||||
* <code>fraction</code> representing the proportion between the start and end values. The
|
||||
* calculation is a simple parametric calculation: <code>result = x0 + t * (v1 - v0)</code>,
|
||||
* where <code>x0</code> is <code>startValue</code>, <code>x1</code> is <code>endValue</code>,
|
||||
* and <code>t</code> is <code>fraction</code>.
|
||||
*
|
||||
* @param fraction The fraction from the starting to the ending values
|
||||
* @param startValue The start value; should be of type <code>int</code> or
|
||||
* <code>Integer</code>
|
||||
* @param endValue The end value; should be of type <code>int</code> or <code>Integer</code>
|
||||
* @return A linear interpolation between the start and end values, given the
|
||||
* <code>fraction</code> parameter.
|
||||
*/
|
||||
public Integer evaluate(float fraction, Integer startValue, Integer endValue) {
|
||||
int startInt = startValue;
|
||||
return (int) (startInt + fraction * (endValue - startInt));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.adins.mss.svy.tool;
|
||||
|
||||
import com.adins.mss.foundation.formatter.Tool;
|
||||
import com.adins.mss.foundation.image.Utils;
|
||||
import com.adins.mss.svy.R;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.view.Gravity;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
public class ImageThumbnail extends LinearLayout{
|
||||
|
||||
ImageView imgView;
|
||||
TextView detailText;
|
||||
private Bitmap thumbnail = null;
|
||||
byte[] resultImg = null;
|
||||
|
||||
|
||||
public ImageThumbnail(Context context, int width, int height) {
|
||||
super(context);
|
||||
|
||||
//Init container
|
||||
this.setOrientation(LinearLayout.VERTICAL);
|
||||
this.setGravity(Gravity.LEFT);
|
||||
|
||||
//Init image thumbnail
|
||||
imgView = new ImageView(context);
|
||||
ViewGroup.LayoutParams imgLayout = new LayoutParams(width, height);
|
||||
imgView.setLayoutParams(imgLayout);
|
||||
imgView.setImageResource(R.drawable.ic_image);
|
||||
|
||||
//Init detail text
|
||||
detailText = new TextView(context);
|
||||
detailText.setTextColor(Color.BLACK);
|
||||
|
||||
this.addView(imgView);
|
||||
// this.addView(detailText);
|
||||
}
|
||||
public byte[] getResultImg() {
|
||||
return resultImg;
|
||||
}
|
||||
|
||||
public void setResultImg(byte[] resultImg) throws Exception{
|
||||
this.resultImg = resultImg;
|
||||
|
||||
try{
|
||||
Bitmap bm = Utils.byteToBitmap(resultImg);
|
||||
int[] res = Tool.getThumbnailResolution(bm.getWidth(), bm.getHeight());
|
||||
Bitmap thumbnail = Bitmap.createScaledBitmap(bm, res[0], res[1], true);
|
||||
imgView.setImageBitmap(thumbnail);
|
||||
detailText.setText(" "+bm.getWidth()+" x " +bm.getHeight()+". Size "+ resultImg.length +" Bytes");
|
||||
}
|
||||
catch(Exception e){
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
public void setImageResource(int res){
|
||||
imgView.setImageResource(res);
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 214 KiB |
Loading…
Add table
Add a link
Reference in a new issue