Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
| /* | |
| * Copyright 2015 Johannes Homeier | |
| * | |
| * 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 |
| import android.animation.ObjectAnimator; | |
| import android.os.Bundle; | |
| import android.support.annotation.NonNull; | |
| import android.support.v7.app.AppCompatActivity; | |
| import android.util.Property; | |
| import android.view.View; | |
| import android.view.animation.DecelerateInterpolator; | |
| import android.widget.FrameLayout; | |
| public class MainActivity extends AppCompatActivity { |
| <?xml version="1.0" encoding="utf-8"?> | |
| <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
| <item> | |
| <shape> | |
| <gradient | |
| android:angle="0" | |
| android:endColor="#19FFFFFF" | |
| android:startColor="#FFFFFFFF" /> | |
| <size | |
| android:width="20dp" |
| package com.nestia.android.pay.utils; | |
| import android.support.annotation.NonNull; | |
| import android.text.Editable; | |
| import android.text.InputType; | |
| import android.text.Selection; | |
| import android.text.TextWatcher; | |
| import android.text.method.DigitsKeyListener; | |
| import android.widget.EditText; |
| import android.content.Context; | |
| import android.graphics.Canvas; | |
| import android.graphics.Color; | |
| import android.graphics.Paint; | |
| import android.graphics.RectF; | |
| import android.support.annotation.Nullable; | |
| import android.util.AttributeSet; | |
| import android.view.View; | |
| import com.nestia.android.uikit.UiUtils; |
| /* | |
| * Copyright (C) 2017 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 |
| /* | |
| * Copyright (C) 2017 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 |
| 1. 动态创建等分GridLayout,需要用到layout_columnWeight/Height(对应column/RowSpec)属性,注意调用的api(下方note) (bug: 如果child count比coloum count小,UI显示有问题) | |
| for (TopUpProduct.TopUpType.Product product : products) { | |
| TextView textView = (TextView) mInflater.inflate(R.layout.np_item_call_charge, mGridLayout, false); | |
| textView.setText("S$ " + product.getPrice()); | |
| mGridLayout.addView(textView); | |
| GridLayout.LayoutParams layoutParams = (GridLayout.LayoutParams) textView.getLayoutParams(); | |
| layoutParams.columnSpec = GridLayout.spec(GridLayout.UNDEFINED, 1f); //note: 1f | |
| layoutParams.leftMargin = UiUtils.dp2px(getContext(), 6); | |
| layoutParams.rightMargin = UiUtils.dp2px(getContext(), 6); | |
| layoutParams.topMargin = UiUtils.dp2px(getContext(), 16); |
Git 比较不同版本文件差异的常用命令格式:
git diff 查看尚未暂存的文件更新了哪些部分
git diff filename 查看尚未暂存的某个文件更新了哪些
git diff –cached 查看已经暂存起来的文件和上次提交的版本之间的差异
git diff –cached filename 查看已经暂存起来的某个文件和上次提交的版本之间的差异
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |