以上就是给各位分享JavaScript无符号位移运算符>>>三个大于号的使用方法,其中也会对js里面三个等于号进行解释,同时本文还将给你拓展ABAPworkbenchAPI的使用方法、ABAP中的in
以上就是给各位分享JavaScript 无符号位移运算符 >>> 三个大于号 的使用方法,其中也会对js里面三个等于号进行解释,同时本文还将给你拓展ABAP workbench API 的使用方法、ABAP 中的 include type | structure 的使用方法、ABAP中的 include type | structure 的使用方法、Android 开源控件 ViewPager Indicator 的使用方法等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!
本文目录一览:- JavaScript 无符号位移运算符 >>> 三个大于号 的使用方法(js里面三个等于号)
- ABAP workbench API 的使用方法
- ABAP 中的 include type | structure 的使用方法
- ABAP中的 include type | structure 的使用方法
- Android 开源控件 ViewPager Indicator 的使用方法
JavaScript 无符号位移运算符 >>> 三个大于号 的使用方法(js里面三个等于号)
D3群里的呆神发现源码中的>>>运算符,我拿出来po一下
d3.bisector(accessor)
是一种指定参数accessor或者比较器函数返回一个二等分对象。返回的对象有left和right两个属性。分别类似于bisectLeft和bisectRight方法。
这个方法适用于对象数组而不适用于原始的简单数组。
N>>>1
就代表N的二进制右移一位,二进制右移一位就能得到中间值。
例如
10>>>1
10的二进制代码为 1010
向右移动一位后为 0101
即 5
ABAP workbench API 的使用方法
该报表演示了如何用 ABAP 代码实现 SE80 事务码里的资源创建工作。
REPORT ZCREATE.
data: lr_tool TYPE REF TO ZCL_PRODUCT_WB_ACCESS,
lr_state TYPE REF TO IF_WB_PROGRAM_STATE,
lr_i_state TYPE REF TO CL_WB_ABSTRACT_TOOL_STATE,
lr_container TYPE REF TO CL_WB_DATA_CONTAINER,
lr_request type ref to CL_WB_REQUEST.
CREATE OBJECT lr_tool.
CREATE OBJECT lr_i_state
EXPORTING
p_parentnode_key = ''$TMP''
p_parentnode_type = ''K''.
CREATE OBJECT lr_request
EXPORTING
p_object_type = ''Q0E''
p_operation = ''CREATE''
p_object_name = ''ZZ''
p_object_state = lr_i_state.
call method lr_tool->IF_WB_PROGRAM~process_wb_request
EXPORTING
p_wb_request = lr_request
p_wb_program_state = lr_state
p_window_id = 0
CHANGING
p_wb_data_container = lr_container
EXCEPTIONS
action_cancelled = swbm_c_er_action_cancelled
error_occured = swbm_c_er_error_occured
object_not_found = swbm_c_er_object_not_found
operation_not_supported = swbm_c_er_op_not_supported
permission_failure = swbm_c_er_permission_failure
wrong_program_state = swbm_c_er_wrong_program_state
OTHERS = swbm_c_er_unknown_error.
要获取更多 Jerry 的原创文章,请关注公众号 "汪子熙":
本文分享 CSDN - 汪子熙。
如有侵权,请联系 support@oschina.cn 删除。
本文参与 “OSC 源创计划”,欢迎正在阅读的你也加入,一起分享。
ABAP 中的 include type | structure 的使用方法
看一本书上写 include type | structure 的使用方法真是太简单了,而且没有例子。
该语句的主要作用是使别的结构体中的组件全部包括进来成为自己的组件。
比如:
REPORT z_mike_type_002.
TYPES:
BEGIN OF user,
username(10) TYPE c,
END OF user,
BEGIN OF info,
age TYPE i.
INCLUDE TYPE user.
TYPES: END OF info.
DATA my_info TYPE info.
my_info-username = ''mike''.
WRITE my_info-username.
结果为:
ABAP中的 include type | structure 的使用方法
看一本书上写 include type | structure 的使用方法真是太简单了,而且没有例子。
该语句的主要作用是使别的结构体中的组件全部包括进来成为自己的组件。
比如:
REPORT z_mike_type_002.
TYPES:
BEGIN OF user,
username(10) TYPE c,
END OF user,
BEGIN OF info,
age TYPE i.
INCLUDE TYPE user.
TYPES: END OF info.
DATA my_info TYPE info.
my_info-username = ''mike''.
WRITE my_info-username.
结果为:
Android 开源控件 ViewPager Indicator 的使用方法
Android Viewpager Indicator 是 Android 开发中最常用的控件之一,几乎所有的新闻类 APP 中都有使用,下面介绍其基本使用方法。
1. ViewPager Indicator 的 Library
查看 Viewpager Indicator 的 Library 代码,可以看到此项目的设计思想:
首先定义了一个 PageIndicator 接口,它里面定义了最重要和基本的 indicator 表现出的一些方法:
1.1 首先一个 indicator 必须要与一个 ViewPager 关联在一起,所以它提供了一个 setViewPager 方法。
1.2 它扩展了 ViewPager.OnPageChangeListener 接口,表示接管了 ViewPager 的 Pager 改变时的监听处理,
这也是为什么为 ViewPager 设置 OnPageChangeListener 监听器时不能设置在 ViewPager 上而必须设置在
indicator 上的原因。
1.3 还有一个 notifyDataSetChanged 通知方法,表示为这个 ViewPager 提供 View (一般是 Fragment) 的 Adapter 里面的数据集发生变化时,执行的动作,这里可增加相关的逻辑。
2. Viewpager Indicator 的实现类
然后再看下 Viewpager Indicator 的实现类,共有 6 个,由 6 个类分别实现,它们分别为:
2.1 小圆圈类型的
2.2 带图标类型的
2.3 小横线类型的,距离屏幕最下边端有一定的距离。
2.4 标签类型的(Tab)
2.5 标题类型的,与标签类型的有点像,但它当前的标题页的左 / 右边的标题会卷起,即往两端缩进去。
2.6 屏幕底部小横线类型的,并且会占满整行。
3. Viewpager Indicator 随附带的 Demo
3.1 Demo 项目的设计
项目由一个 ListSamples 的 ListActivity 入口,它主要用作组装所有的子 indicator 的列表。
TestFragment.java,所有 ViewPager 上真正显示的视图。
TestFragmentAdapter.java,所有 ViewPager 里的 Adapter,为 ViewPager 生成 TestFragment。
Samplexxx.java,所有的 indicator 的显示,一个类显示一种使用方法或特性。
3.2 具体使用方法
查看 SampleCirclesDefault.java 基本就可以明白它的基本使用方法:
首先,把 Indicator 包含进 xml 文件中,如下,注意它应该紧邻在 ViewPager 的上方或下方,总之要挨在一起。
<com.viewpagerindicator.TitlePageIndicator
android:id="@+id/titles"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
其次,使用 titleIndicator.setViewPager (pager) 把两者绑定在一起,如下所示:
//Set the pager with an adapter
ViewPager pager = (ViewPager)findViewById(R.id.pager);
pager.setAdapter(new TestAdapter(getSupportFragmentManager()));
//Bind the title indicator to the adapter
TitlePageIndicator titleIndicator = (TitlePageIndicator)findViewById(R.id.titles);
titleIndicator.setViewPager(pager);
最后,如果你要监听 ViewPager 中包含的 Fragment 的改变 (手滑动切换了页面),使用 OnPageChangeListener 为它指定一个监听器,那么不能直接设置在 ViewPager 上,而要设置在 Indicator 上,如下所示:
//continued from above
titleIndicator.setOnPageChangeListener(mPageChangeListener);
4. 修改 indicator 的样式(Theme)
4.1 Theme XML,在 AndroidManifest.xml 中相应的 Activity 中设置,比如:
<activity
android:name=".SampleCirclesStyledTheme"
android:label="Circles/Styled (via theme)"
android:theme="@style/StyledIndicators">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="com.jakewharton.android.viewpagerindicator.sample.SAMPLE" />
</intent-filter>
</activity>
android:theme="@style/StyledIndicators" ==> values/styles.xml 中相应部分为:
<resources>
<style name="StyledIndicators" parent="@android:style/Theme.Light">
<item name="vpiCirclePageIndicatorStyle">@style/CustomCirclePageIndicator</item>
<item name="vpiLinePageIndicatorStyle">@style/CustomLinePageIndicator</item>
<item name="vpiTitlePageIndicatorStyle">@style/CustomTitlePageIndicator</item>
<item name="vpiTabPageIndicatorStyle">@style/CustomTabPageIndicator</item>
<item name="vpiUnderlinePageIndicatorStyle">@style/CustomUnderlinePageIndicator</item>
</style>
4.2 Layout XML,在 Layout XML 方法中指定,如下:
<android.support.v4.view.ViewPager
android:id="@+id/pager"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
/>
<com.viewpagerindicator.CirclePageIndicator
android:id="@+id/indicator"
android:padding="10dip"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:background="#FFCCCCCC"
app:radius="10dp"
app:fillColor="#FF888888"
app:pageColor="#88FF0000"
app:strokeColor="#FF000000"
app:strokeWidth="2dp"
/>
4.3 Object methods,直接在代码中设置,如下:
CirclePageIndicator indicator = (CirclePageIndicator)findViewById(R.id.indicator);
mIndicator = indicator;
indicator.setViewPager(mPager);
final float density = getResources().getDisplayMetrics().density;
indicator.setBackgroundColor(0xFFCCCCCC);
indicator.setRadius(10 * density);
indicator.setPageColor(0x880000FF);
indicator.setFillColor(0xFF888888);
indicator.setStrokeColor(0xFF000000);
indicator.setStrokeWidth(2 * density);
具体有哪些属性可以参考 library 项目中的 vpi__attrs.xml 文件。
参考:
https://github.com/JakeWharton/Android-ViewPagerIndicator
今天关于JavaScript 无符号位移运算符 >>> 三个大于号 的使用方法和js里面三个等于号的介绍到此结束,谢谢您的阅读,有关ABAP workbench API 的使用方法、ABAP 中的 include type | structure 的使用方法、ABAP中的 include type | structure 的使用方法、Android 开源控件 ViewPager Indicator 的使用方法等更多相关知识的信息可以在本站进行查询。
本文标签: